-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Nullability annotations for HttpListener #41189
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs
Outdated
Show resolved
Hide resolved
aik-jahoda
left a comment
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.
Added few comments.
src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpConnection.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpConnection.cs
Show resolved
Hide resolved
src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs
Outdated
Show resolved
Hide resolved
| int length = (int)_memoryStream.Length; | ||
| byte[] buffer = _memoryStream!.GetBuffer(); | ||
| int length = (int)_memoryStream!.Length; | ||
| _memoryStream = null; |
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.
@aik-jahoda shouldn't we call _memoryStream.Dispose() here? I find it weird that it is being set to null.
I ask because this is what forced Prashanth to make _memoryStream nullable.
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 wouldn't change behaviour now but create follow up work for .NET 6. I'm fine with nullable _memoryStream since we have this discussion recorder here for future fix.
aik-jahoda
left a comment
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.
LGTM
cc @aik-jahoda @jozkee @krwq