Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 8def273

Browse files
committed
Merge pull request #2907 from dotnet-bot/from-tfs
Merge changes from TFS
2 parents ada2a4c + ac9e5d9 commit 8def273

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ private async void StartRequest(object obj)
11901190
await state.RequestMessage.Content.CopyToAsync(
11911191
requestStream,
11921192
state.TransportContext).ConfigureAwait(false);
1193-
requestStream.Flush();
1193+
requestStream.EndUpload();
11941194
}
11951195

11961196
state.CancellationToken.ThrowIfCancellationRequested();

src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ public override long Position
7777

7878
public override void Flush()
7979
{
80-
if (_chunkedMode)
81-
{
82-
WriteData(s_endChunk, 0, s_endChunk.Length);
83-
}
8480
}
8581

8682
public override void Write(byte[] buffer, int offset, int count)
@@ -128,6 +124,14 @@ public override int Read(byte[] buffer, int offset, int count)
128124
throw new NotSupportedException();
129125
}
130126

127+
internal void EndUpload()
128+
{
129+
if (_chunkedMode)
130+
{
131+
WriteData(s_endChunk, 0, s_endChunk.Length);
132+
}
133+
}
134+
131135
protected override void Dispose(bool disposing)
132136
{
133137
if (disposing && !_disposed)

0 commit comments

Comments
 (0)