From 5210323385ea6e2753258aa6ee47a7ea8e7b4750 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 3 Apr 2018 10:08:50 -0700 Subject: [PATCH] Merge release/2.1 into dev --- Directory.Build.props | 2 ++ build/dependencies.props | 14 ++++++------- .../Server/IISHttpContext.ReadWrite.cs | 20 +++++++++---------- .../Server/IISHttpContext.Websockets.cs | 4 ++-- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 46a1159f78..3bb2bcbca8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,6 +16,8 @@ true true true + + false diff --git a/build/dependencies.props b/build/dependencies.props index 5cd40704ec..676abb32d9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -35,14 +35,14 @@ 2.1.0-preview3-32094 15.6.1 7.0.0 - 4.5.0-preview2-26326-04 - 4.5.0-preview2-26326-04 + 4.5.0-preview2-26313-01 + 4.5.0-preview2-26313-01 6.1.7601.17515 - 4.5.0-preview2-26326-04 - 4.5.0-preview2-26326-04 - 4.5.0-preview2-26326-04 - 4.5.0-preview2-26326-04 - 4.5.0-preview2-26326-04 + 4.5.0-preview2-26313-01 + 4.5.0-preview2-26313-01 + 4.5.0-preview2-26313-01 + 4.5.0-preview2-26313-01 + 4.5.0-preview2-26313-01 9.0.1 2.3.1 2.4.0-beta.1.build3945 diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.ReadWrite.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.ReadWrite.cs index 7b5f18efce..d6480cde9a 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.ReadWrite.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.ReadWrite.cs @@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration internal Task WriteAsync(ReadOnlyMemory memory, CancellationToken cancellationToken = default(CancellationToken)) { - // Want to keep exceptions consistent, + // Want to keep exceptions consistent, if (!_hasResponseStarted) { return WriteAsyncAwaited(memory, cancellationToken); @@ -135,7 +135,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration await writeTask; } - // ConsumeAsync is called when either the first read or first write is done. + // ConsumeAsync is called when either the first read or first write is done. // There are two modes for reading and writing to the request/response bodies without upgrade. // 1. Await all reads and try to read from the Output pipe // 2. Done reading and await all writes. @@ -265,7 +265,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { ref var handle = ref handles[currentChunk]; ref var chunk = ref pDataChunks[currentChunk]; - handle = b.Retain(true); + handle = b.Pin(); chunk.DataChunkType = HttpApiTypes.HTTP_DATA_CHUNK_TYPE.HttpDataChunkFromMemory; chunk.fromMemory.BufferLength = (uint)b.Length; @@ -281,13 +281,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration { handle.Dispose(); } - + return hr; } private unsafe IISAwaitable FlushToIISAsync() { - // Calls flush + // Calls flush var hr = 0; hr = NativeMethods.HttpFlushResponseBytes(_pInProcessHandler, out var fCompletionExpected); if (!fCompletionExpected) @@ -356,9 +356,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration return; } - // Now we handle the read. + // Now we handle the read. var memory = Input.Writer.GetMemory(); - _inputHandle = memory.Retain(true); + _inputHandle = memory.Pin(); try { @@ -368,7 +368,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration // read value of 0 == done reading // read value of -1 == read cancelled, still allowed to read but we - // need a write to occur first. + // need a write to occur first. if (read == 0) { break; @@ -388,7 +388,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration // Flush the read data for the Input Pipe writer var flushResult = await Input.Writer.FlushAsync(); - // If the pipe was closed, we are done reading, + // If the pipe was closed, we are done reading, if (flushResult.IsCompleted || flushResult.IsCanceled) { break; @@ -437,7 +437,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration } else { - // Flush of zero bytes will + // Flush of zero bytes will await FlushToIISAsync(); } } diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.Websockets.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.Websockets.cs index 6ddbdef865..75a1efba1e 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.Websockets.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContext.Websockets.cs @@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration ref var handle = ref handles[currentChunk]; ref var chunk = ref pDataChunks[currentChunk]; - handle = b.Retain(true); + handle = b.Pin(); chunk.DataChunkType = HttpApiTypes.HTTP_DATA_CHUNK_TYPE.HttpDataChunkFromMemory; chunk.fromMemory.BufferLength = (uint)b.Length; @@ -152,7 +152,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration while (true) { var memory = Input.Writer.GetMemory(); - _inputHandle = memory.Retain(true); + _inputHandle = memory.Pin(); try {