grpc 1.30.2 → 1.31.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +560 -619
- data/include/grpc/grpc_security_constants.h +3 -0
- data/include/grpc/impl/codegen/grpc_types.h +7 -5
- data/include/grpc/impl/codegen/port_platform.h +0 -32
- data/src/core/ext/filters/client_channel/backend_metric.cc +12 -9
- data/src/core/ext/filters/client_channel/client_channel.cc +406 -265
- data/src/core/ext/filters/client_channel/config_selector.cc +62 -0
- data/src/core/ext/filters/client_channel/config_selector.h +93 -0
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -2
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +2 -0
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +6 -5
- data/src/core/ext/filters/client_channel/http_proxy.cc +6 -4
- data/src/core/ext/filters/client_channel/lb_policy.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +39 -23
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +4 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc +376 -68
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +5 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +6 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +8 -6
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +9 -7
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +7 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +33 -48
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +6 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +21 -18
- data/src/core/ext/filters/client_channel/resolver_registry.cc +13 -14
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -7
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +33 -28
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +39 -20
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +142 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +1 -1
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +327 -123
- data/src/core/ext/filters/client_channel/xds/xds_api.h +72 -7
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +12 -23
- data/src/core/ext/filters/client_channel/xds/xds_client.cc +112 -33
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +10 -10
- data/src/core/ext/filters/http/client/http_client_filter.cc +5 -5
- data/src/core/ext/filters/http/http_filters_plugin.cc +2 -1
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +74 -33
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +3 -1
- data/src/core/ext/filters/message_size/message_size_filter.cc +56 -80
- data/src/core/ext/filters/message_size/message_size_filter.h +6 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +383 -347
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +6 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +1 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -13
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +19 -4
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +22 -27
- data/src/core/ext/transport/chttp2/transport/flow_control.h +14 -16
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +9 -12
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -6
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +12 -13
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +6 -7
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +9 -12
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +25 -29
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +13 -17
- data/src/core/ext/transport/chttp2/transport/internal.h +13 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +33 -43
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -14
- data/src/core/ext/transport/inproc/inproc_transport.cc +35 -15
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +3 -4
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/auth/common.upb.h +80 -69
- data/src/core/ext/upb-generated/envoy/api/v2/auth/secret.upb.h +24 -23
- data/src/core/ext/upb-generated/envoy/api/v2/auth/tls.upb.h +66 -56
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +317 -311
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +42 -34
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h +7 -7
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +79 -61
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +55 -49
- data/src/core/ext/upb-generated/envoy/api/v2/core/backoff.upb.h +9 -8
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +163 -169
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +51 -45
- data/src/core/ext/upb-generated/envoy/api/v2/core/event_service_config.upb.h +4 -5
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +107 -100
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +137 -117
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h +9 -9
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +105 -87
- data/src/core/ext/upb-generated/envoy/api/v2/core/socket_option.upb.h +12 -13
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h +95 -101
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +49 -65
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +49 -42
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h +70 -62
- data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +81 -65
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +91 -80
- data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +9 -10
- data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +36 -31
- data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +648 -696
- data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +16 -15
- data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +95 -88
- data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +234 -199
- data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +5 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v2/http_tracer.upb.h +13 -13
- data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h +1 -2
- data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h +20 -18
- data/src/core/ext/upb-generated/envoy/type/http.upb.h +0 -1
- data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +18 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +14 -14
- data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +23 -23
- data/src/core/ext/upb-generated/envoy/type/percent.upb.h +8 -9
- data/src/core/ext/upb-generated/envoy/type/range.upb.h +15 -16
- data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +7 -8
- data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +36 -35
- data/src/core/ext/upb-generated/gogoproto/gogo.upb.h +0 -1
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +0 -1
- data/src/core/ext/upb-generated/google/api/http.upb.h +29 -28
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +5 -6
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +412 -386
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +5 -6
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +1 -2
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +33 -54
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +5 -6
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +27 -28
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +8 -8
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +1 -1
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +32 -45
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +4 -4
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +157 -178
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +14 -13
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +6 -7
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +59 -56
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +11 -12
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +0 -1
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +5 -6
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +6 -6
- data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +41 -68
- data/src/core/ext/upb-generated/validate/validate.upb.h +536 -535
- data/src/core/lib/channel/channel_trace.cc +2 -6
- data/src/core/lib/channel/channelz.cc +5 -15
- data/src/core/lib/gpr/log_linux.cc +6 -8
- data/src/core/lib/gpr/log_posix.cc +6 -8
- data/src/core/lib/gpr/string.cc +10 -9
- data/src/core/lib/gpr/string.h +4 -2
- data/src/core/lib/gprpp/global_config_env.cc +8 -6
- data/src/core/lib/http/httpcli.cc +13 -10
- data/src/core/lib/http/httpcli_security_connector.cc +5 -5
- data/src/core/lib/iomgr/cfstream_handle.cc +1 -0
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +10 -10
- data/src/core/lib/iomgr/error_cfstream.cc +9 -8
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +5 -6
- data/src/core/lib/iomgr/ev_epollex_linux.cc +15 -21
- data/src/core/lib/iomgr/ev_poll_posix.cc +6 -5
- data/src/core/lib/iomgr/ev_posix.cc +2 -0
- data/src/core/lib/iomgr/iomgr.cc +10 -0
- data/src/core/lib/iomgr/iomgr.h +10 -0
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +14 -0
- data/src/core/lib/iomgr/port.h +1 -21
- data/src/core/lib/iomgr/resolve_address_custom.cc +13 -18
- data/src/core/lib/iomgr/resolve_address_windows.cc +8 -8
- data/src/core/lib/iomgr/resource_quota.cc +34 -31
- data/src/core/lib/iomgr/sockaddr_utils.cc +7 -5
- data/src/core/lib/iomgr/sockaddr_utils.h +1 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +95 -55
- data/src/core/lib/iomgr/socket_windows.cc +4 -5
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +9 -11
- data/src/core/lib/iomgr/tcp_client_custom.cc +6 -9
- data/src/core/lib/iomgr/tcp_client_posix.cc +27 -36
- data/src/core/lib/iomgr/tcp_client_windows.cc +9 -9
- data/src/core/lib/iomgr/tcp_custom.cc +1 -1
- data/src/core/lib/iomgr/tcp_custom.h +1 -1
- data/src/core/lib/iomgr/tcp_server.cc +3 -4
- data/src/core/lib/iomgr/tcp_server.h +7 -5
- data/src/core/lib/iomgr/tcp_server_custom.cc +6 -14
- data/src/core/lib/iomgr/tcp_server_posix.cc +34 -41
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -7
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +4 -9
- data/src/core/lib/iomgr/tcp_server_windows.cc +16 -16
- data/src/core/lib/iomgr/timer_generic.cc +13 -12
- data/src/core/lib/iomgr/udp_server.cc +24 -23
- data/src/core/lib/iomgr/udp_server.h +5 -2
- data/src/core/lib/iomgr/unix_sockets_posix.cc +9 -14
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -1
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +5 -2
- data/src/core/lib/json/json_reader.cc +20 -21
- data/src/core/lib/security/credentials/credentials.h +5 -3
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +8 -6
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +12 -9
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -4
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +19 -28
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -6
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +20 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +10 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +10 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
- data/src/core/lib/security/security_connector/security_connector.cc +2 -0
- data/src/core/lib/security/security_connector/security_connector.h +1 -1
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +18 -11
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +5 -0
- data/src/core/lib/security/security_connector/ssl_utils.cc +44 -23
- data/src/core/lib/security/security_connector/ssl_utils.h +6 -2
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +27 -24
- data/src/core/lib/security/transport/client_auth_filter.cc +10 -9
- data/src/core/lib/security/util/json_util.cc +12 -13
- data/src/core/lib/slice/slice.cc +38 -1
- data/src/core/lib/slice/slice_internal.h +1 -0
- data/src/core/lib/surface/call.cc +40 -41
- data/src/core/lib/surface/completion_queue.cc +271 -14
- data/src/core/lib/surface/completion_queue.h +8 -0
- data/src/core/lib/surface/init.cc +2 -0
- data/src/core/lib/surface/server.cc +565 -632
- data/src/core/lib/surface/server.h +34 -12
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/transport.h +6 -0
- data/src/core/lib/uri/uri_parser.cc +8 -15
- data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +23 -13
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -0
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -0
- data/src/core/tsi/ssl_transport_security.cc +102 -11
- data/src/core/tsi/ssl_transport_security.h +14 -2
- data/src/core/tsi/transport_security_interface.h +5 -0
- data/src/ruby/ext/grpc/extconf.rb +5 -2
- data/src/ruby/ext/grpc/rb_call.c +3 -2
- data/src/ruby/ext/grpc/rb_call.h +4 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +54 -10
- data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/err_data.c +89 -83
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +12 -52
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +0 -22
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +143 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/mode_wrappers.c +17 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +11 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +13 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-x86_64.c +24 -23
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +20 -16
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/util.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +62 -0
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +29 -15
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +36 -5
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +0 -29
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +116 -363
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +7 -45
- data/third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +8 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509.c +0 -67
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +13 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +10 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +41 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +28 -9
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +25 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +35 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +0 -154
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +28 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +74 -35
- data/third_party/boringssl-with-bazel/src/include/openssl/aes.h +16 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +22 -22
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +69 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +33 -16
- data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +1 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +789 -715
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +3 -3
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +9 -2
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +9 -0
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +17 -14
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -7
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +28 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +4 -24
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +5 -5
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +45 -24
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +31 -21
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +12 -9
- data/third_party/upb/upb/decode.c +467 -504
- data/third_party/upb/upb/encode.c +163 -121
- data/third_party/upb/upb/msg.c +130 -64
- data/third_party/upb/upb/msg.h +418 -14
- data/third_party/upb/upb/port_def.inc +35 -6
- data/third_party/upb/upb/port_undef.inc +8 -1
- data/third_party/upb/upb/table.c +53 -75
- data/third_party/upb/upb/table.int.h +11 -43
- data/third_party/upb/upb/upb.c +148 -124
- data/third_party/upb/upb/upb.h +65 -147
- data/third_party/upb/upb/upb.hpp +86 -0
- metadata +40 -37
- data/third_party/upb/upb/generated_util.h +0 -105
@@ -30,6 +30,7 @@
|
|
30
30
|
|
31
31
|
#include <grpc/slice_buffer.h>
|
32
32
|
|
33
|
+
#include "re2/re2.h"
|
33
34
|
#include "src/core/ext/filters/client_channel/server_address.h"
|
34
35
|
#include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
|
35
36
|
#include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
|
@@ -46,12 +47,74 @@ class XdsApi {
|
|
46
47
|
static const char* kEdsTypeUrl;
|
47
48
|
|
48
49
|
struct RdsUpdate {
|
50
|
+
// TODO(donnadionne): When we can use absl::variant<>, consider using that
|
51
|
+
// for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
|
49
52
|
struct RdsRoute {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
// Matchers for this route.
|
54
|
+
struct Matchers {
|
55
|
+
struct PathMatcher {
|
56
|
+
enum class PathMatcherType {
|
57
|
+
PATH, // path stored in string_matcher field
|
58
|
+
PREFIX, // prefix stored in string_matcher field
|
59
|
+
REGEX, // regex stored in regex_matcher field
|
60
|
+
};
|
61
|
+
PathMatcherType type;
|
62
|
+
std::string string_matcher;
|
63
|
+
std::unique_ptr<RE2> regex_matcher;
|
64
|
+
bool operator==(const PathMatcher& other) const {
|
65
|
+
if (type != other.type) return false;
|
66
|
+
if (type == PathMatcherType::REGEX) {
|
67
|
+
// Should never be null.
|
68
|
+
if (regex_matcher == nullptr || other.regex_matcher == nullptr) {
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
return regex_matcher->pattern() == other.regex_matcher->pattern();
|
72
|
+
}
|
73
|
+
return string_matcher == other.string_matcher;
|
74
|
+
}
|
75
|
+
std::string ToString() const;
|
76
|
+
};
|
77
|
+
struct HeaderMatcher {
|
78
|
+
enum class HeaderMatcherType {
|
79
|
+
EXACT, // value stored in string_matcher field
|
80
|
+
REGEX, // uses regex_match field
|
81
|
+
RANGE, // uses range_start and range_end fields
|
82
|
+
PRESENT, // uses present_match field
|
83
|
+
PREFIX, // prefix stored in string_matcher field
|
84
|
+
SUFFIX, // suffix stored in string_matcher field
|
85
|
+
};
|
86
|
+
std::string name;
|
87
|
+
HeaderMatcherType type;
|
88
|
+
int64_t range_start;
|
89
|
+
int64_t range_end;
|
90
|
+
std::string string_matcher;
|
91
|
+
std::unique_ptr<RE2> regex_match;
|
92
|
+
bool present_match;
|
93
|
+
// invert_match field may or may not exisit, so initialize it to
|
94
|
+
// false.
|
95
|
+
bool invert_match = false;
|
96
|
+
bool operator==(const HeaderMatcher& other) const {
|
97
|
+
return (name == other.name && type == other.type &&
|
98
|
+
range_start == other.range_start &&
|
99
|
+
range_end == other.range_end &&
|
100
|
+
string_matcher == other.string_matcher &&
|
101
|
+
present_match == other.present_match &&
|
102
|
+
invert_match == other.invert_match);
|
103
|
+
}
|
104
|
+
std::string ToString() const;
|
105
|
+
};
|
106
|
+
PathMatcher path_matcher;
|
107
|
+
std::vector<HeaderMatcher> header_matchers;
|
108
|
+
absl::optional<uint32_t> fraction_per_million;
|
109
|
+
bool operator==(const Matchers& other) const {
|
110
|
+
return (path_matcher == other.path_matcher &&
|
111
|
+
header_matchers == other.header_matchers &&
|
112
|
+
fraction_per_million == other.fraction_per_million);
|
113
|
+
}
|
114
|
+
std::string ToString() const;
|
115
|
+
};
|
116
|
+
Matchers matchers;
|
117
|
+
// Action for this route.
|
55
118
|
std::string cluster_name;
|
56
119
|
struct ClusterWeight {
|
57
120
|
std::string name;
|
@@ -60,14 +123,16 @@ class XdsApi {
|
|
60
123
|
bool operator==(const ClusterWeight& other) const {
|
61
124
|
return (name == other.name && weight == other.weight);
|
62
125
|
}
|
126
|
+
std::string ToString() const;
|
63
127
|
};
|
64
128
|
std::vector<ClusterWeight> weighted_clusters;
|
65
129
|
|
66
130
|
bool operator==(const RdsRoute& other) const {
|
67
|
-
return (
|
131
|
+
return (matchers == other.matchers &&
|
68
132
|
cluster_name == other.cluster_name &&
|
69
133
|
weighted_clusters == other.weighted_clusters);
|
70
134
|
}
|
135
|
+
std::string ToString() const;
|
71
136
|
};
|
72
137
|
|
73
138
|
std::vector<RdsRoute> routes;
|
@@ -75,6 +140,7 @@ class XdsApi {
|
|
75
140
|
bool operator==(const RdsUpdate& other) const {
|
76
141
|
return routes == other.routes;
|
77
142
|
}
|
143
|
+
std::string ToString() const;
|
78
144
|
};
|
79
145
|
|
80
146
|
// TODO(roth): When we can use absl::variant<>, consider using that
|
@@ -269,7 +335,6 @@ class XdsApi {
|
|
269
335
|
private:
|
270
336
|
XdsClient* client_;
|
271
337
|
TraceFlag* tracer_;
|
272
|
-
const bool xds_routing_enabled_;
|
273
338
|
const XdsBootstrap::Node* node_;
|
274
339
|
const std::string build_version_;
|
275
340
|
const std::string user_agent_name_;
|
@@ -23,12 +23,11 @@
|
|
23
23
|
#include <errno.h>
|
24
24
|
#include <stdlib.h>
|
25
25
|
|
26
|
+
#include "absl/strings/str_cat.h"
|
26
27
|
#include "absl/strings/str_format.h"
|
27
28
|
#include "absl/strings/str_join.h"
|
28
29
|
#include "absl/strings/string_view.h"
|
29
30
|
|
30
|
-
#include <grpc/support/string_util.h>
|
31
|
-
|
32
31
|
#include "src/core/lib/gpr/env.h"
|
33
32
|
#include "src/core/lib/gpr/string.h"
|
34
33
|
#include "src/core/lib/iomgr/load_file.h"
|
@@ -98,11 +97,9 @@ std::unique_ptr
|
|
98
97
|
Json json = Json::Parse(contents_str_view, error);
|
99
98
|
grpc_slice_unref_internal(contents);
|
100
99
|
if (*error != GRPC_ERROR_NONE) {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(msg, error, 1);
|
105
|
-
gpr_free(msg);
|
100
|
+
grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
|
101
|
+
absl::StrCat("Failed to parse bootstrap file ", path.get()).c_str(),
|
102
|
+
error, 1);
|
106
103
|
GRPC_ERROR_UNREF(*error);
|
107
104
|
*error = error_out;
|
108
105
|
return nullptr;
|
@@ -154,10 +151,8 @@ grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
|
|
154
151
|
for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
|
155
152
|
Json& child = json->mutable_array()->at(i);
|
156
153
|
if (child.type() != Json::Type::OBJECT) {
|
157
|
-
|
158
|
-
|
159
|
-
error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
|
160
|
-
gpr_free(msg);
|
154
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
155
|
+
absl::StrCat("array element ", i, " is not an object").c_str()));
|
161
156
|
} else {
|
162
157
|
grpc_error* parse_error = ParseXdsServer(&child, i);
|
163
158
|
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
|
@@ -194,10 +189,8 @@ grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
|
|
194
189
|
// Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
|
195
190
|
// string is not static in this case.
|
196
191
|
if (error_list.empty()) return GRPC_ERROR_NONE;
|
197
|
-
|
198
|
-
|
199
|
-
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
200
|
-
gpr_free(msg);
|
192
|
+
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
193
|
+
absl::StrCat("errors parsing index ", idx).c_str());
|
201
194
|
for (size_t i = 0; i < error_list.size(); ++i) {
|
202
195
|
error = grpc_error_add_child(error, error_list[i]);
|
203
196
|
}
|
@@ -210,10 +203,8 @@ grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
|
|
210
203
|
for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
|
211
204
|
Json& child = json->mutable_array()->at(i);
|
212
205
|
if (child.type() != Json::Type::OBJECT) {
|
213
|
-
|
214
|
-
|
215
|
-
error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg));
|
216
|
-
gpr_free(msg);
|
206
|
+
error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
207
|
+
absl::StrCat("array element ", i, " is not an object").c_str()));
|
217
208
|
} else {
|
218
209
|
grpc_error* parse_error = ParseChannelCreds(&child, i, server);
|
219
210
|
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
|
@@ -252,10 +243,8 @@ grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
|
|
252
243
|
// Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
|
253
244
|
// string is not static in this case.
|
254
245
|
if (error_list.empty()) return GRPC_ERROR_NONE;
|
255
|
-
|
256
|
-
|
257
|
-
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
258
|
-
gpr_free(msg);
|
246
|
+
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
247
|
+
absl::StrCat("errors parsing index ", idx).c_str());
|
259
248
|
for (size_t i = 0; i < error_list.size(); ++i) {
|
260
249
|
error = grpc_error_add_child(error, error_list[i]);
|
261
250
|
}
|
@@ -30,7 +30,6 @@
|
|
30
30
|
#include <grpc/byte_buffer_reader.h>
|
31
31
|
#include <grpc/grpc.h>
|
32
32
|
#include <grpc/support/alloc.h>
|
33
|
-
#include <grpc/support/string_util.h>
|
34
33
|
#include <grpc/support/time.h>
|
35
34
|
|
36
35
|
#include "src/core/ext/filters/client_channel/client_channel.h"
|
@@ -180,13 +179,11 @@ class XdsClient::ChannelState::AdsCallState
|
|
180
179
|
void OnTimerLocked(grpc_error* error) {
|
181
180
|
if (error == GRPC_ERROR_NONE && timer_pending_) {
|
182
181
|
timer_pending_ = false;
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
189
|
-
gpr_free(msg);
|
182
|
+
grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
183
|
+
absl::StrFormat(
|
184
|
+
"timeout obtaining resource {type=%s name=%s} from xds server",
|
185
|
+
type_url_, name_)
|
186
|
+
.c_str());
|
190
187
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
|
191
188
|
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
|
192
189
|
grpc_error_string(watcher_error));
|
@@ -894,14 +891,12 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
|
|
894
891
|
? lds_update->route_config_name.c_str()
|
895
892
|
: "<inlined>"));
|
896
893
|
if (lds_update->rds_update.has_value()) {
|
897
|
-
gpr_log(GPR_INFO, "
|
894
|
+
gpr_log(GPR_INFO, "RouteConfiguration contains %" PRIuPTR " routes",
|
898
895
|
lds_update->rds_update.value().routes.size());
|
899
|
-
for (
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
route.service.c_str(), route.method.c_str(),
|
904
|
-
route.cluster_name.c_str());
|
896
|
+
for (size_t i = 0; i < lds_update->rds_update.value().routes.size();
|
897
|
+
++i) {
|
898
|
+
gpr_log(GPR_INFO, "Route %" PRIuPTR ":\n%s", i,
|
899
|
+
lds_update->rds_update.value().routes[i].ToString().c_str());
|
905
900
|
}
|
906
901
|
}
|
907
902
|
}
|
@@ -959,12 +954,9 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
|
|
959
954
|
"[xds_client %p] RDS update received; RouteConfiguration contains "
|
960
955
|
"%" PRIuPTR " routes",
|
961
956
|
this, rds_update.value().routes.size());
|
962
|
-
for (
|
963
|
-
gpr_log(GPR_INFO,
|
964
|
-
|
965
|
-
"method=\"%s\" }, cluster=\"%s\" }",
|
966
|
-
route.service.c_str(), route.method.c_str(),
|
967
|
-
route.cluster_name.c_str());
|
957
|
+
for (size_t i = 0; i < rds_update.value().routes.size(); ++i) {
|
958
|
+
gpr_log(GPR_INFO, "Route %" PRIuPTR ":\n%s", i,
|
959
|
+
rds_update.value().routes[i].ToString().c_str());
|
968
960
|
}
|
969
961
|
}
|
970
962
|
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
|
@@ -1097,8 +1089,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1097
1089
|
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1098
1090
|
" %s has weight %d, contains %" PRIuPTR " server addresses",
|
1099
1091
|
xds_client(), priority, locality_count,
|
1100
|
-
locality.name->AsHumanReadableString()
|
1101
|
-
locality.serverlist.size());
|
1092
|
+
locality.name->AsHumanReadableString().c_str(),
|
1093
|
+
locality.lb_weight, locality.serverlist.size());
|
1102
1094
|
for (size_t i = 0; i < locality.serverlist.size(); ++i) {
|
1103
1095
|
std::string ipport = grpc_sockaddr_to_string(
|
1104
1096
|
&locality.serverlist[i].address(), false);
|
@@ -1106,7 +1098,8 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
|
|
1106
1098
|
"[xds_client %p] Priority %" PRIuPTR ", locality %" PRIuPTR
|
1107
1099
|
" %s, server address %" PRIuPTR ": %s",
|
1108
1100
|
xds_client(), priority, locality_count,
|
1109
|
-
locality.name->AsHumanReadableString(), i,
|
1101
|
+
locality.name->AsHumanReadableString().c_str(), i,
|
1102
|
+
ipport.c_str());
|
1110
1103
|
}
|
1111
1104
|
++locality_count;
|
1112
1105
|
}
|
@@ -2024,17 +2017,103 @@ std::string CreateServiceConfigActionCluster(const std::string& cluster_name) {
|
|
2024
2017
|
}
|
2025
2018
|
|
2026
2019
|
std::string CreateServiceConfigRoute(const std::string& action_name,
|
2027
|
-
const
|
2028
|
-
|
2020
|
+
const XdsApi::RdsUpdate::RdsRoute& route) {
|
2021
|
+
std::vector<std::string> headers;
|
2022
|
+
for (const auto& header : route.matchers.header_matchers) {
|
2023
|
+
std::string header_matcher;
|
2024
|
+
switch (header.type) {
|
2025
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2026
|
+
HeaderMatcherType::EXACT:
|
2027
|
+
header_matcher = absl::StrFormat(" \"exact_match\": \"%s\"",
|
2028
|
+
header.string_matcher);
|
2029
|
+
break;
|
2030
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2031
|
+
HeaderMatcherType::REGEX:
|
2032
|
+
header_matcher = absl::StrFormat(" \"regex_match\": \"%s\"",
|
2033
|
+
header.regex_match->pattern());
|
2034
|
+
break;
|
2035
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2036
|
+
HeaderMatcherType::RANGE:
|
2037
|
+
header_matcher = absl::StrFormat(
|
2038
|
+
" \"range_match\":{\n"
|
2039
|
+
" \"start\":%d,\n"
|
2040
|
+
" \"end\":%d\n"
|
2041
|
+
" }",
|
2042
|
+
header.range_start, header.range_end);
|
2043
|
+
break;
|
2044
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2045
|
+
HeaderMatcherType::PRESENT:
|
2046
|
+
header_matcher =
|
2047
|
+
absl::StrFormat(" \"present_match\": %s",
|
2048
|
+
header.present_match ? "true" : "false");
|
2049
|
+
break;
|
2050
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2051
|
+
HeaderMatcherType::PREFIX:
|
2052
|
+
header_matcher = absl::StrFormat(
|
2053
|
+
" \"prefix_match\": \"%s\"", header.string_matcher);
|
2054
|
+
break;
|
2055
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher::
|
2056
|
+
HeaderMatcherType::SUFFIX:
|
2057
|
+
header_matcher = absl::StrFormat(
|
2058
|
+
" \"suffix_match\": \"%s\"", header.string_matcher);
|
2059
|
+
break;
|
2060
|
+
default:
|
2061
|
+
break;
|
2062
|
+
}
|
2063
|
+
std::vector<std::string> header_parts;
|
2064
|
+
header_parts.push_back(
|
2065
|
+
absl::StrFormat(" { \n"
|
2066
|
+
" \"name\": \"%s\",\n",
|
2067
|
+
header.name));
|
2068
|
+
header_parts.push_back(header_matcher);
|
2069
|
+
if (header.invert_match) {
|
2070
|
+
header_parts.push_back(
|
2071
|
+
absl::StrFormat(",\n"
|
2072
|
+
" \"invert_match\": true"));
|
2073
|
+
}
|
2074
|
+
header_parts.push_back(
|
2075
|
+
absl::StrFormat("\n"
|
2076
|
+
" }"));
|
2077
|
+
headers.push_back(absl::StrJoin(header_parts, ""));
|
2078
|
+
}
|
2079
|
+
std::vector<std::string> headers_service_config;
|
2080
|
+
if (!headers.empty()) {
|
2081
|
+
headers_service_config.push_back("\"headers\":[\n");
|
2082
|
+
headers_service_config.push_back(absl::StrJoin(headers, ","));
|
2083
|
+
headers_service_config.push_back(" ],\n");
|
2084
|
+
}
|
2085
|
+
std::string path_match_str;
|
2086
|
+
switch (route.matchers.path_matcher.type) {
|
2087
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2088
|
+
PREFIX:
|
2089
|
+
path_match_str = absl::StrFormat(
|
2090
|
+
"\"prefix\": \"%s\",\n", route.matchers.path_matcher.string_matcher);
|
2091
|
+
break;
|
2092
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2093
|
+
PATH:
|
2094
|
+
path_match_str = absl::StrFormat(
|
2095
|
+
"\"path\": \"%s\",\n", route.matchers.path_matcher.string_matcher);
|
2096
|
+
break;
|
2097
|
+
case XdsApi::RdsUpdate::RdsRoute::Matchers::PathMatcher::PathMatcherType::
|
2098
|
+
REGEX:
|
2099
|
+
path_match_str =
|
2100
|
+
absl::StrFormat("\"regex\": \"%s\",\n",
|
2101
|
+
route.matchers.path_matcher.regex_matcher->pattern());
|
2102
|
+
break;
|
2103
|
+
}
|
2029
2104
|
return absl::StrFormat(
|
2030
2105
|
" { \n"
|
2031
|
-
"
|
2032
|
-
"
|
2033
|
-
"
|
2034
|
-
"
|
2035
|
-
" \"action\": \"%s\"\n"
|
2106
|
+
" %s"
|
2107
|
+
" %s"
|
2108
|
+
" %s"
|
2109
|
+
" \"action\": \"%s\"\n"
|
2036
2110
|
" }",
|
2037
|
-
|
2111
|
+
path_match_str, absl::StrJoin(headers_service_config, ""),
|
2112
|
+
route.matchers.fraction_per_million.has_value()
|
2113
|
+
? absl::StrFormat("\"match_fraction\":%d,\n",
|
2114
|
+
route.matchers.fraction_per_million.value())
|
2115
|
+
: "",
|
2116
|
+
action_name);
|
2038
2117
|
}
|
2039
2118
|
|
2040
2119
|
// Create the service config for one weighted cluster.
|
@@ -2216,7 +2295,7 @@ grpc_error* XdsClient::CreateServiceConfig(
|
|
2216
2295
|
absl::StrFormat("%s:%s",
|
2217
2296
|
route.weighted_clusters.empty() ? "cds" : "weighted",
|
2218
2297
|
action_name),
|
2219
|
-
route
|
2298
|
+
route));
|
2220
2299
|
}
|
2221
2300
|
std::vector<std::string> config_parts;
|
2222
2301
|
config_parts.push_back(
|
@@ -22,11 +22,12 @@
|
|
22
22
|
#include <grpc/support/port_platform.h>
|
23
23
|
|
24
24
|
#include <map>
|
25
|
+
#include <string>
|
25
26
|
|
27
|
+
#include "absl/strings/str_cat.h"
|
28
|
+
#include "absl/strings/str_format.h"
|
26
29
|
#include "absl/strings/string_view.h"
|
27
30
|
|
28
|
-
#include <grpc/support/string_util.h>
|
29
|
-
|
30
31
|
#include "src/core/lib/gprpp/atomic.h"
|
31
32
|
#include "src/core/lib/gprpp/memory.h"
|
32
33
|
#include "src/core/lib/gprpp/ref_counted.h"
|
@@ -79,21 +80,20 @@ class XdsLocalityName : public RefCounted
|
|
79
80
|
const std::string& zone() const { return zone_; }
|
80
81
|
const std::string& sub_zone() const { return sub_zone_; }
|
81
82
|
|
82
|
-
const
|
83
|
-
if (human_readable_string_
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
human_readable_string_.reset(tmp);
|
83
|
+
const std::string& AsHumanReadableString() {
|
84
|
+
if (human_readable_string_.empty()) {
|
85
|
+
human_readable_string_ =
|
86
|
+
absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
|
87
|
+
region_, zone_, sub_zone_);
|
88
88
|
}
|
89
|
-
return human_readable_string_
|
89
|
+
return human_readable_string_;
|
90
90
|
}
|
91
91
|
|
92
92
|
private:
|
93
93
|
std::string region_;
|
94
94
|
std::string zone_;
|
95
95
|
std::string sub_zone_;
|
96
|
-
|
96
|
+
std::string human_readable_string_;
|
97
97
|
};
|
98
98
|
|
99
99
|
// Drop stats for an xds cluster.
|
@@ -23,12 +23,12 @@
|
|
23
23
|
#include <string>
|
24
24
|
#include <vector>
|
25
25
|
|
26
|
+
#include "absl/strings/str_cat.h"
|
26
27
|
#include "absl/strings/str_format.h"
|
27
28
|
#include "absl/strings/str_join.h"
|
28
29
|
|
29
30
|
#include <grpc/support/alloc.h>
|
30
31
|
#include <grpc/support/log.h>
|
31
|
-
#include <grpc/support/string_util.h>
|
32
32
|
|
33
33
|
#include "src/core/ext/filters/http/client/http_client_filter.h"
|
34
34
|
#include "src/core/lib/gpr/string.h"
|
@@ -121,8 +121,8 @@ static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
|
|
121
121
|
} else {
|
122
122
|
char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
|
123
123
|
GPR_DUMP_ASCII);
|
124
|
-
|
125
|
-
|
124
|
+
std::string msg =
|
125
|
+
absl::StrCat("Received http2 header with status: ", val);
|
126
126
|
grpc_error* e = grpc_error_set_str(
|
127
127
|
grpc_error_set_int(
|
128
128
|
grpc_error_set_str(
|
@@ -131,9 +131,9 @@ static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
|
|
131
131
|
GRPC_ERROR_STR_VALUE, grpc_slice_from_copied_string(val)),
|
132
132
|
GRPC_ERROR_INT_GRPC_STATUS,
|
133
133
|
grpc_http2_status_to_grpc_status(atoi(val))),
|
134
|
-
GRPC_ERROR_STR_GRPC_MESSAGE,
|
134
|
+
GRPC_ERROR_STR_GRPC_MESSAGE,
|
135
|
+
grpc_slice_from_cpp_string(std::move(msg)));
|
135
136
|
gpr_free(val);
|
136
|
-
gpr_free(msg);
|
137
137
|
return e;
|
138
138
|
}
|
139
139
|
}
|