Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reflection from KestrelServer constructor #50272

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/Servers/Kestrel/Core/src/KestrelServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public KestrelServer(IOptions<KestrelServerOptions> options, IConnectionListener
options,
new[] { transportFactory ?? throw new ArgumentNullException(nameof(transportFactory)) },
Array.Empty<IMultiplexedConnectionListenerFactory>(),
new SimpleHttpsConfigurationService(loggerFactory),
new SimpleHttpsConfigurationService(),
loggerFactory,
new KestrelMetrics(new DummyMeterFactory()));
}
Expand Down Expand Up @@ -77,13 +77,6 @@ public void Dispose() { }

private sealed class SimpleHttpsConfigurationService : IHttpsConfigurationService
{
private readonly ILogger<HttpsConnectionMiddleware> _httpsLogger;

public SimpleHttpsConfigurationService(ILoggerFactory loggerFactory)
{
_httpsLogger = loggerFactory.CreateLogger<HttpsConnectionMiddleware>();
}

public bool IsInitialized => true;

public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer> serverLogger, ILogger<HttpsConnectionMiddleware> httpsLogger)
Expand All @@ -93,7 +86,7 @@ public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer>

public void PopulateMultiplexedTransportFeatures(FeatureCollection features, ListenOptions listenOptions)
{
HttpsConfigurationService.PopulateMultiplexedTransportFeaturesWorker(features, listenOptions, _httpsLogger);
amcasey marked this conversation as resolved.
Show resolved Hide resolved
throw new NotImplementedException(); // Not actually required by this impl, which never provides an IMultiplexedConnectionListenerFactory
}

public ListenOptions UseHttpsWithDefaults(ListenOptions listenOptions)
Expand Down
Loading