-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 unnecessary call #55795
remove unnecessary call #55795
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsWe call SafeMsQuicConfigurationHandle.Create twice but used only once configuration.
|
Does this closes #55158. Could you link it here and close it with this PR if so? |
fixes #55158 |
@wfurt it needs to be in top post to work with GH -- I added it there ... just FYI |
@@ -27,7 +27,7 @@ internal sealed class MsQuicConnection : QuicConnectionProvider | |||
|
|||
// TODO: remove this. | |||
// This is only used for client-initiated connections, and isn't needed even then once Connect() has been called. | |||
private readonly SafeMsQuicConfigurationHandle? _configuration; | |||
private SafeMsQuicConfigurationHandle? _configuration; |
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.
Given the comment here, I wonder why we don't just create (and dispose) this in ConnectAsync so we don't have to store the value at all.
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.
I think we may. That would possibly change where exception can be thrown e.g. in constructor were the options are passed in or in Connect. We would need to store all the options too, right?
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.
Yeah, I suppose we need to store the options as well.
Though alternatively, we could pass options to ConnectAsync and never have to store them at all. I don't think we should be making that kind of API change right now, but we can certainly consider it for 7.0.
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.
We call SafeMsQuicConfigurationHandle.Create twice but used only once configuration.
Since we do not need it past connect I Dispose it there so we don't drag it forward.
Fixes #55158