Skip to content

Commit f966ebd

Browse files
authored
envoy: bump upstream to c687308 (#1886)
Integrates envoyproxy/envoy#17479 & envoyproxy/envoy#17521 Envoy diff: envoyproxy/envoy@a5b3af2...c687308 This PR: * Creates a new `extension_registry_platform_additions` library where platform-specific additions to the extensions can be configured. Currently only registers the Apple DNS resolver extension factory and no-ops on non-Apple platforms but more can be added here in the future. * Implements the new `Stream::bytesMeter()` function on `DirectStream`. * Increases the max binary size from 7.2MB to 7.3MB. We were already within 1% of that on `main` so it didn't take much new code to go over this limit.
1 parent ff6922b commit f966ebd

10 files changed

+55
-2
lines changed

ci/test_size_regression.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Checks the absolute size and the relative size increase of a file.
44

5-
MAX_SIZE=7200000 # 7.2MB
5+
MAX_SIZE=7300000 # 7.3MB
66
MAX_PERC=2.0
77

88
if [ `uname` == "Darwin" ]

envoy

Submodule envoy updated 268 files

envoy_build_config/BUILD

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ envoy_cc_library(
1212
hdrs = ["extension_registry.h"],
1313
repository = "@envoy",
1414
deps = [
15+
"extension_registry_platform_additions",
1516
"@envoy//source/common/network:socket_lib",
1617
"@envoy//source/common/upstream:logical_dns_cluster_lib",
1718
"@envoy//source/extensions/clusters/dynamic_forward_proxy:cluster",
@@ -35,3 +36,17 @@ envoy_cc_library(
3536
"@envoy_mobile//library/common/extensions/retry/options/network_configuration:config",
3637
],
3738
)
39+
40+
envoy_cc_library(
41+
name = "extension_registry_platform_additions",
42+
srcs = select({
43+
"@envoy//bazel:apple": ["extension_registry_apple.cc"],
44+
"//conditions:default": ["extension_registry_noop.cc"],
45+
}),
46+
hdrs = ["extension_registry_platform_additions.h"],
47+
repository = "@envoy",
48+
deps = select({
49+
"@envoy//bazel:apple": ["@envoy//source/extensions/network/dns_resolver/apple:config"],
50+
"//conditions:default": [],
51+
}),
52+
)

envoy_build_config/extension_registry.cc

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "source/extensions/transport_sockets/tls/config.h"
1717
#include "source/extensions/upstreams/http/generic/config.h"
1818

19+
#include "extension_registry_platform_additions.h"
1920
#include "library/common/extensions/filters/http/assertion/config.h"
2021
#include "library/common/extensions/filters/http/platform_bridge/config.h"
2122

@@ -46,6 +47,7 @@ void ExtensionRegistry::registerFactories() {
4647
Envoy::Extensions::TransportSockets::Tls::forceRegisterDefaultCertValidatorFactory();
4748
Envoy::Extensions::Upstreams::Http::Generic::forceRegisterGenericGenericConnPoolFactory();
4849
Envoy::Upstream::forceRegisterLogicalDnsClusterFactory();
50+
ExtensionRegistryPlatformAdditions::registerFactories();
4951

5052
// TODO: add a "force initialize" function to the upstream code, or clean up the upstream code
5153
// in such a way that does not depend on the statically initialized variable.

envoy_build_config/extension_registry.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "source/extensions/transport_sockets/tls/config.h"
1717
#include "source/extensions/upstreams/http/generic/config.h"
1818

19+
#include "extension_registry_platform_additions.h"
1920
#include "library/common/extensions/filters/http/assertion/config.h"
2021
#include "library/common/extensions/filters/http/local_error/config.h"
2122
#include "library/common/extensions/filters/http/network_configuration/config.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include "source/extensions/network/dns_resolver/apple/apple_dns_impl.h"
2+
3+
#include "extension_registry_platform_additions.h"
4+
5+
namespace Envoy {
6+
7+
void ExtensionRegistryPlatformAdditions::registerFactories() {
8+
Envoy::Network::forceRegisterAppleDnsResolverFactory();
9+
}
10+
11+
} // namespace Envoy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "extension_registry_platform_additions.h"
2+
3+
namespace Envoy {
4+
5+
void ExtensionRegistryPlatformAdditions::registerFactories() {}
6+
7+
} // namespace Envoy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
namespace Envoy {
4+
class ExtensionRegistryPlatformAdditions {
5+
public:
6+
// As a server, Envoy's static factory registration happens when main is run. However, when
7+
// compiled as a library, there is no guarantee that such registration will happen before the
8+
// names are needed. The following calls ensure that registration happens before the entities are
9+
// needed. Note that as more registrations are needed, explicit initialization calls will need to
10+
// be added here.
11+
static void registerFactories();
12+
};
13+
} // namespace Envoy

envoy_build_config/extensions_build_config.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ EXTENSIONS = {
1414
"envoy.filters.http.router": "//source/extensions/filters/http/router:config",
1515
"envoy.filters.network.http_connection_manager": "//source/extensions/filters/network/http_connection_manager:config",
1616
"envoy.http.original_ip_detection.xff": "//source/extensions/http/original_ip_detection/xff:config",
17+
"envoy.network.dns_resolver.apple": "//source/extensions/network/dns_resolver/apple:config",
1718
"envoy.retry.options.network_configuration": "@envoy_mobile//library/common/extensions/retry/options/network_configuration:config",
1819
"envoy.stat_sinks.metrics_service": "//source/extensions/stat_sinks/metrics_service:config",
1920
"envoy.transport_sockets.raw_buffer": "//source/extensions/transport_sockets/raw_buffer:config",

library/common/http/client.h

+3
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ class Client : public Logger::Loggable<Logger::Id::http> {
232232
}
233233
void setFlushTimeout(std::chrono::milliseconds) override {}
234234

235+
const StreamInfo::BytesMeterSharedPtr& bytesMeter() override { return bytes_meter_; }
236+
235237
// ScopeTrackedObject
236238
void dumpState(std::ostream& os, int indent_level = 0) const override;
237239

@@ -269,6 +271,7 @@ class Client : public Logger::Loggable<Logger::Id::http> {
269271
bool explicit_flow_control_ = false;
270272
// Latest intel data retrieved from the StreamInfo.
271273
envoy_stream_intel stream_intel_;
274+
StreamInfo::BytesMeterSharedPtr bytes_meter_;
272275
};
273276

274277
using DirectStreamSharedPtr = std::shared_ptr<DirectStream>;

0 commit comments

Comments
 (0)