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

[QUIC] Validate Close/Abort errorCode parameter #102264

Merged
merged 3 commits into from
May 16, 2024

Conversation

ManickaP
Copy link
Member

Also shuffle around validation methods for better reuse and fix typo.

Fixes #101385

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@dotnet dotnet deleted a comment from azure-pipelines bot May 15, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot May 15, 2024
@ManickaP
Copy link
Member Author

/azp run runtime-libraries stress-http

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@rzikm rzikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one question.

@@ -447,6 +447,8 @@ public void Abort(QuicAbortDirection abortDirection, long errorCode)
return;
}

ThrowHelper.ValidateErrorCode(nameof(Abort), errorCode);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the compiler-filled parameter propertyName, won't it produce weird error message? Same for QuicConnection.CloseAsync

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you're right: System.ArgumentOutOfRangeException: 'errorCode' should be within [0, 4611686018427387903) range. (Parameter 'CloseAsync')
Changed to: System.ArgumentOutOfRangeException: 'CloseAsync.errorCode' should be within [0, 4611686018427387903) range. (Parameter 'errorCode') obviously for both CloseAsync and Abort.

@ManickaP ManickaP merged commit 044e9d3 into dotnet:main May 16, 2024
83 checks passed
@ManickaP ManickaP deleted the quic-validate-error branch May 16, 2024 16:38
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
* Validate Close/Abort errorCode parameter, shuffle around validation methods for better reuse

* Remove unnecassary PNSE exclusion

* Changed exception text and added tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QUIC] Check inputs for QuicConnection.CloseAsync and QuicStream.Abort
2 participants