Skip to content

HTTP2 loopback server WaitForCancellationAsync should validate error code sent - #59313

Merged
karelz merged 3 commits into
dotnet:mainfrom
pedrobsaila:58235/checkErrorCode
Nov 2, 2021
Merged

HTTP2 loopback server WaitForCancellationAsync should validate error code sent#59313
karelz merged 3 commits into
dotnet:mainfrom
pedrobsaila:58235/checkErrorCode

Conversation

@pedrobsaila

@pedrobsailapedrobsaila commented Sep 19, 2021

Copy link
Copy Markdown
Contributor

Fixes#58235

@ghostghost added community-contribution Indicates that the PR has been added by a community member area-System.Net.Http labels Sep 19, 2021
@ghost

Copy link
Copy Markdown

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

Issue Details

Issue #58235

Author:pedrobsaila
Assignees:-
Labels:

area-System.Net.Http, community-contribution

Milestone:-

Assert.Equal(FrameType.RstStream, frame.Type);
}
} while (frame.Type != FrameType.RstStream);
} while (frame.Type != FrameType.RstStream || (frame is RstStreamFrame rstStreamFrame && rstStreamFrame.ErrorCode != 0x8));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}while(frame.Type!=FrameType.RstStream||(frameisRstStreamFramerstStreamFrame&&rstStreamFrame.ErrorCode!=0x8));
}while(frame.Type!=FrameType.RstStream||(frameisRstStreamFramerstStreamFrame&&rstStreamFrame.ErrorCode!=ProtocolErrors.CANCEL));

I think

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

ErrorCode property is an int, so I casted the enum

@karelzkarelz added this to the 7.0.0 milestone Sep 30, 2021
Assert.Equal(FrameType.RstStream, frame.Type);
}
} while (frame.Type != FrameType.RstStream);
} while (frame.Type != FrameType.RstStream || (frame is RstStreamFrame rstStreamFrame && rstStreamFrame.ErrorCode != (int)ProtocolErrors.CANCEL));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should not receive any RstStream frame other than one containing the CANCEL.

As written, this will just ignore a RstStream that doesn't contain CANCEL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we should rather just assert that the error code is CANCEL, is that what you mean @geoffkizer?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes.

@karelz

Copy link
Copy Markdown
Member

Unrelated test failures:

@karelz
karelz merged commit 176e393 into dotnet:mainNov 2, 2021
@karelz

Copy link
Copy Markdown
Member

Thanks for your PR @pedrobsaila!

@pedrobsaila
pedrobsaila deleted the 58235/checkErrorCode branch November 2, 2021 15:57
@ghostghost locked as resolved and limited conversation to collaborators Dec 2, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net.Httpcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP2 loopback server WaitForCancellationAsync should validate error code sent

4 participants

@pedrobsaila@karelz@danmoseley@geoffkizer