-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Nullability annotations for HttpListener #41189
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
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
byte[] buffer = _memoryStream.GetBuffer(); | ||
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.
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
* src files annotated * ref file * Address feedback
cc @aik-jahoda @jozkee @krwq