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 connection adapters and move things to middleware #11412
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,8 +171,7 @@ public async Task BindAsync(AddressBindContext context) | |
var httpsDefault = ParseAddress(Constants.DefaultServerHttpsAddress, out https); | ||
context.ServerOptions.ApplyEndpointDefaults(httpsDefault); | ||
|
||
if (httpsDefault.ConnectionAdapters.Any(f => f.IsHttps) | ||
|| httpsDefault.TryUseHttps()) | ||
if (httpsDefault.IsTls || httpsDefault.TryUseHttps()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wasn't this necessary in our last PR? Do we not have anything testing this address strategy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this change, ParseAddress would never return a ListenOptions object with a ConnectionAdapter pre-attached anyway. It looks like More evidence of this is that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind. I now see the ApplyEndpointDefaults line. My bad. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was calling UseHttps in the ConfigureEndpointDefaults callback broken before this change? |
||
{ | ||
await httpsDefault.BindAsync(context).ConfigureAwait(false); | ||
context.Logger.LogDebug(CoreStrings.BindingToDefaultAddresses, | ||
|
@@ -255,7 +254,7 @@ public virtual async Task BindAsync(AddressBindContext context) | |
var options = ParseAddress(address, out var https); | ||
context.ServerOptions.ApplyEndpointDefaults(options); | ||
|
||
if (https && !options.ConnectionAdapters.Any(f => f.IsHttps)) | ||
if (https && !options.IsTls) | ||
{ | ||
options.UseHttps(); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ internal async Task Execute(KestrelConnection connection) | |
} | ||
catch (Exception ex) | ||
{ | ||
Log.LogCritical(0, ex, $"{nameof(ConnectionDispatcher)}.{nameof(Execute)}() {connectionContext.ConnectionId}"); | ||
Log.LogError(0, ex, "Unhandled exception while processing {ConnectionId}.", connectionContext.ConnectionId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why change this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a critical exception if middleware throws, it's just an error now. Any user code can cause this to happen. |
||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastienros This will break the benchmarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically this https://github.com/aspnet/Benchmarks/blob/fd69bc294bdfda8d23a9e094dfbbb4a56fa82651/src/Benchmarks/PassthroughConnectionFilter.cs#L12