diff --git a/pkg/Microsoft.Private.PackageBaseline/packageIndex.json b/pkg/Microsoft.Private.PackageBaseline/packageIndex.json
index e0c70ca49abd..16d71a2749f8 100644
--- a/pkg/Microsoft.Private.PackageBaseline/packageIndex.json
+++ b/pkg/Microsoft.Private.PackageBaseline/packageIndex.json
@@ -2601,7 +2601,8 @@
"4.7.1",
"4.7.2",
"4.7.3",
- "4.7.4"
+ "4.7.4",
+ "4.7.5"
],
"BaselineVersion": "4.7.0",
"InboxOn": {},
@@ -2612,7 +2613,8 @@
"4.0.2.0": "4.7.0",
"4.0.2.1": "4.7.1",
"4.0.2.2": "4.7.3",
- "4.0.2.3": "4.7.4"
+ "4.0.2.3": "4.7.4",
+ "4.0.2.4": "4.7.5"
}
},
"System.IO.Pipes": {
diff --git a/src/System.IO.Pipelines/Directory.Build.props b/src/System.IO.Pipelines/Directory.Build.props
index a921bd7d4ac6..f1197d7cf16b 100644
--- a/src/System.IO.Pipelines/Directory.Build.props
+++ b/src/System.IO.Pipelines/Directory.Build.props
@@ -1,8 +1,8 @@
- 4.0.2.3
- 4.7.4
+ 4.0.2.4
+ 4.7.5
Open
\ No newline at end of file
diff --git a/src/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs b/src/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs
index 8129fa7b2c1c..46bb11869e30 100644
--- a/src/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs
+++ b/src/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs
@@ -1005,7 +1005,7 @@ private void WriteMultiSegment(ReadOnlySpan 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
diff --git a/src/System.IO.Pipelines/tests/PipeLengthTests.cs b/src/System.IO.Pipelines/tests/PipeLengthTests.cs
index acc447e0e708..b63ad6944b8f 100644
--- a/src/System.IO.Pipelines/tests/PipeLengthTests.cs
+++ b/src/System.IO.Pipelines/tests/PipeLengthTests.cs
@@ -278,5 +278,19 @@ public async Task NullExaminedAndConsumedNoops()
ReadResult result = await _pipe.Reader.ReadAsync();
_pipe.Reader.AdvanceTo(default, default);
}
+
+ [Fact]
+ public async Task AdvanceFollowedByWriteAsyncTest()
+ {
+ Memory buffer = new byte[26];
+ Pipe pipe = new Pipe(new PipeOptions(minimumSegmentSize: 1));
+
+ var mem = pipe.Writer.GetMemory(14).Slice(0, 14);
+ buffer.Slice(0, 14).CopyTo(mem);
+ pipe.Writer.Advance(14);
+ await pipe.Writer.WriteAsync(buffer.Slice(14));
+ ReadResult res = await pipe.Reader.ReadAsync();
+ Assert.Equal(res.Buffer.Length, buffer.Length);
+ }
}
}
diff --git a/src/packages.builds b/src/packages.builds
index 55f7886509ec..3f200853f23c 100644
--- a/src/packages.builds
+++ b/src/packages.builds
@@ -26,6 +26,9 @@
$(AdditionalProperties)
+
+ $(AdditionalProperties)
+