Skip to content

Throw from ReadAsync() and TryRead() if called twice in a row #155

Merged
AArnott merged 6 commits intomasterfrom
fix153
Dec 13, 2019
Merged

Throw from ReadAsync() and TryRead() if called twice in a row #155
AArnott merged 6 commits intomasterfrom
fix153

Conversation

@AArnott
Copy link
Copy Markdown
Collaborator

@AArnott AArnott commented Dec 13, 2019

Fixes #153

AArnott and others added 4 commits December 9, 2019 11:29
Avoid accessing ReadResult.Buffer after PipeReader.AdvanceTo
This is consistent with PipeReader.AdvanceTo behavior.
Fix the `PipeReader` returned from `Stream.UseStrictPipeReader` to throw if `ReadAsync(CancellationToken)` or `TryRead(out ReadResult)` is called after a prior call to either of these methods without an `AdvanceTo` method call happening in between them.
This makes our `PipeReader` behave the same as the one from .NET's own `Pipe` class.
@AArnott AArnott added this to the v2.5 milestone Dec 13, 2019
@AArnott AArnott self-assigned this Dec 13, 2019
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 13, 2019

Codecov Report

Merging #155 into master will decrease coverage by 0.56%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
- Coverage   90.91%   90.35%   -0.57%     
==========================================
  Files          34       34              
  Lines        2433     2447      +14     
==========================================
- Hits         2212     2211       -1     
- Misses        221      236      +15
Impacted Files Coverage Δ
src/Nerdbank.Streams/StreamPipeReader.cs 97.56% <100%> (+0.19%) ⬆️
src/Nerdbank.Streams/Strings.Designer.cs 53.84% <100%> (+8.39%) ⬆️
src/Nerdbank.Streams/Sequence`1.cs 99.3% <100%> (+0.03%) ⬆️
src/Nerdbank.Streams/MultiplexingStream.Channel.cs 90.33% <0%> (-6.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 827b1f1...55cebc5. Read the comment docs.

@AArnott AArnott merged commit e40be72 into master Dec 13, 2019
@AArnott AArnott deleted the fix153 branch December 13, 2019 21:32
AArnott added a commit that referenced this pull request Jun 7, 2022
Fix several Install-DotNetSdk issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream.UseStringPipeReader() should throw from ReadAsync and TryRead if AdvanceTo isn't called since last call

1 participant