Skip to content

Commit

Permalink
Merge in 'release/5.0' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Jan 7, 2022
2 parents 85e316c + 6d975f9 commit d5b56c6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libraries/System.IO.Pipelines/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
<ServicingVersion>1</ServicingVersion>
<ServicingVersion>2</ServicingVersion>
<!-- This should be pinned to 5.0.0.1 for non-netfx assets as it is part of aspnetcore ref pack.-->
<AssemblyVersion>5.0.0.1</AssemblyVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ private void WriteMultiSegment(ReadOnlySpan<byte> source)
}

// We filled the segment
_writingHead.End += writable;
_writingHead.End += _writingHeadBytesBuffered;
_writingHeadBytesBuffered = 0;

// This is optimized to use pooled memory. That's why we pass 0 instead of
Expand Down
14 changes: 14 additions & 0 deletions src/libraries/System.IO.Pipelines/tests/PipeLengthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,19 @@ public async Task NullExaminedAndConsumedNoops()
ReadResult result = await _pipe.Reader.ReadAsync();
_pipe.Reader.AdvanceTo(default, default);
}

[Fact]
public async Task AdvanceFollowedByWriteAsyncTest()
{
Memory<byte> buffer = new byte[26];
Pipe pipe = new(new PipeOptions(minimumSegmentSize: 1));

var mem = pipe.Writer.GetMemory(14)[..14];
buffer[..14].CopyTo(mem);
pipe.Writer.Advance(14);
await pipe.Writer.WriteAsync(buffer[14..]);
ReadResult res = await pipe.Reader.ReadAsync();
Assert.Equal(res.Buffer.Length, buffer.Length);
}
}
}
1 change: 1 addition & 0 deletions src/libraries/libraries-packages.proj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" Condition="'$(BuildAllOOBPackages)' == 'true'" />
<ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\**\*.pkgproj" Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true') And '$(BuildAllOOBPackages)' == 'true'" />
<!-- If setting BuildAllOOBPackages to false, add bellow the individual OOB packages you want to continue to build -->
<ProjectReference Include="$(MSBuildThisFileDirectory)System.IO.Pipelines\pkg\System.IO.Pipelines.pkgproj" Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true') And '$(BuildAllOOBPackages)' == 'true'" />
<!-- This is merge marker 1 to help automerge -->
<!-- This is merge marker 2 to help automerge -->
<!-- This is merge marker 3 to help automerge -->
Expand Down

0 comments on commit d5b56c6

Please sign in to comment.