diff options
Diffstat (limited to 'src/core/ext/xds/xds_listener.cc')
-rw-r--r-- | src/core/ext/xds/xds_listener.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/core/ext/xds/xds_listener.cc b/src/core/ext/xds/xds_listener.cc index c4b12f5388..df7bf59e02 100644 --- a/src/core/ext/xds/xds_listener.cc +++ b/src/core/ext/xds/xds_listener.cc @@ -20,7 +20,6 @@ #include <stdint.h> -#include <initializer_list> #include <set> #include <utility> @@ -37,7 +36,6 @@ #include "envoy/config/listener/v3/listener.upb.h" #include "envoy/config/listener/v3/listener.upbdefs.h" #include "envoy/config/listener/v3/listener_components.upb.h" -#include "envoy/config/rbac/v3/rbac.upb.h" #include "envoy/config/route/v3/route.upb.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h" @@ -45,7 +43,6 @@ #include "google/protobuf/any.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/wrappers.upb.h" -#include "upb/base/string_view.h" #include "upb/text/encode.h" #include <grpc/support/log.h> @@ -60,6 +57,7 @@ #include "src/core/lib/gprpp/match.h" #include "src/core/lib/gprpp/validation_errors.h" #include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/lib/matchers/matchers.h" namespace grpc_core { @@ -293,8 +291,9 @@ void MaybeLogHttpConnectionManager( envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef( context.symtab); char buf[10240]; - upb_TextEncode(http_connection_manager_config, msg_type, nullptr, 0, buf, - sizeof(buf)); + upb_TextEncode( + reinterpret_cast<const upb_Message*>(http_connection_manager_config), + msg_type, nullptr, 0, buf, sizeof(buf)); gpr_log(GPR_DEBUG, "[xds_client %p] HttpConnectionManager: %s", context.client, buf); } @@ -334,11 +333,15 @@ XdsListenerResource::HttpConnectionManager HttpConnectionManagerParse( } // original_ip_detection_extensions -- must be empty as per // https://github.com/grpc/proposal/blob/master/A41-xds-rbac.md - if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_original_ip_detection_extensions( - http_connection_manager_proto)) { - ValidationErrors::ScopedField field(errors, - ".original_ip_detection_extensions"); - errors->AddError("must be empty"); + { + size_t size; + envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions( + http_connection_manager_proto, &size); + if (size != 0) { + ValidationErrors::ScopedField field(errors, + ".original_ip_detection_extensions"); + errors->AddError("must be empty"); + } } // common_http_protocol_options const envoy_config_core_v3_HttpProtocolOptions* options = @@ -1093,7 +1096,8 @@ void MaybeLogListener(const XdsResourceType::DecodeContext& context, const upb_MessageDef* msg_type = envoy_config_listener_v3_Listener_getmsgdef(context.symtab); char buf[10240]; - upb_TextEncode(listener, msg_type, nullptr, 0, buf, sizeof(buf)); + upb_TextEncode(reinterpret_cast<const upb_Message*>(listener), msg_type, + nullptr, 0, buf, sizeof(buf)); gpr_log(GPR_DEBUG, "[xds_client %p] Listener: %s", context.client, buf); } } |