parent
87629bbad9
commit
6d442c1e3d
|
|
@ -74,27 +74,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
}
|
}
|
||||||
else if (buffer.IsSingleSegment)
|
else if (buffer.IsSingleSegment)
|
||||||
{
|
{
|
||||||
#if NETCOREAPP2_1
|
|
||||||
await stream.WriteAsync(buffer.First);
|
await stream.WriteAsync(buffer.First);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var array = buffer.First.GetArray();
|
|
||||||
await stream.WriteAsync(array.Array, array.Offset, array.Count);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (var memory in buffer)
|
foreach (var memory in buffer)
|
||||||
{
|
{
|
||||||
#if NETCOREAPP2_1
|
|
||||||
await stream.WriteAsync(memory);
|
await stream.WriteAsync(memory);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var array = memory.GetArray();
|
|
||||||
await stream.WriteAsync(array.Array, array.Offset, array.Count);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -131,14 +117,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
{
|
{
|
||||||
|
|
||||||
var outputBuffer = Input.Writer.GetMemory(MinAllocBufferSize);
|
var outputBuffer = Input.Writer.GetMemory(MinAllocBufferSize);
|
||||||
#if NETCOREAPP2_1
|
|
||||||
var bytesRead = await stream.ReadAsync(outputBuffer);
|
var bytesRead = await stream.ReadAsync(outputBuffer);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var array = outputBuffer.GetArray();
|
|
||||||
var bytesRead = await stream.ReadAsync(array.Array, array.Offset, array.Count);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
Input.Writer.Advance(bytesRead);
|
Input.Writer.Advance(bytesRead);
|
||||||
|
|
||||||
if (bytesRead == 0)
|
if (bytesRead == 0)
|
||||||
|
|
|
||||||
|
|
@ -83,17 +83,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override int Read(Span<byte> destination)
|
public override int Read(Span<byte> destination)
|
||||||
{
|
{
|
||||||
int read = _inner.Read(destination);
|
int read = _inner.Read(destination);
|
||||||
Log("Read", destination.Slice(0, read));
|
Log("Read", destination.Slice(0, read));
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public async override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public async override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
@ -102,17 +97,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override async ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
public override async ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
int read = await _inner.ReadAsync(destination, cancellationToken);
|
int read = await _inner.ReadAsync(destination, cancellationToken);
|
||||||
Log("ReadAsync", destination.Span.Slice(0, read));
|
Log("ReadAsync", destination.Span.Slice(0, read));
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override long Seek(long offset, SeekOrigin origin)
|
public override long Seek(long offset, SeekOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
@ -130,16 +120,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
_inner.Write(buffer, offset, count);
|
_inner.Write(buffer, offset, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override void Write(ReadOnlySpan<byte> source)
|
public override void Write(ReadOnlySpan<byte> source)
|
||||||
{
|
{
|
||||||
Log("Write", source);
|
Log("Write", source);
|
||||||
_inner.Write(source);
|
_inner.Write(source);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
@ -147,16 +132,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
return _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
return _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
Log("WriteAsync", source.Span);
|
Log("WriteAsync", source.Span);
|
||||||
return _inner.WriteAsync(source, cancellationToken);
|
return _inner.WriteAsync(source, cancellationToken);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private void Log(string method, ReadOnlySpan<byte> buffer)
|
private void Log(string method, ReadOnlySpan<byte> buffer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,15 +69,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count)).AsTask();
|
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count)).AsTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
return ReadAsyncInternal(destination);
|
return ReadAsyncInternal(destination);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override void Write(byte[] buffer, int offset, int count)
|
public override void Write(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
|
|
@ -94,16 +89,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
|
||||||
await _output.FlushAsync(cancellationToken);
|
await _output.FlushAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override async ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
public override async ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
_output.Write(source.Span);
|
_output.Write(source.Span);
|
||||||
await _output.FlushAsync(cancellationToken);
|
await _output.FlushAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -111,17 +111,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
||||||
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
|
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
ValidateState(cancellationToken);
|
ValidateState(cancellationToken);
|
||||||
|
|
||||||
return ReadAsyncInternal(destination, cancellationToken);
|
return ReadAsyncInternal(destination, cancellationToken);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private async ValueTask<int> ReadAsyncInternal(Memory<byte> buffer, CancellationToken cancellationToken)
|
private async ValueTask<int> ReadAsyncInternal(Memory<byte> buffer, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -112,17 +112,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
||||||
return _httpResponseControl.WriteAsync(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken);
|
return _httpResponseControl.WriteAsync(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
ValidateState(cancellationToken);
|
ValidateState(cancellationToken);
|
||||||
|
|
||||||
return new ValueTask(_httpResponseControl.WriteAsync(source, cancellationToken));
|
return new ValueTask(_httpResponseControl.WriteAsync(source, cancellationToken));
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public void StartAcceptingWrites()
|
public void StartAcceptingWrites()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -145,15 +145,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
||||||
return _requestStream.ReadAsync(buffer, offset, count, cancellationToken);
|
return _requestStream.ReadAsync(buffer, offset, count, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
return _requestStream.ReadAsync(destination, cancellationToken);
|
return _requestStream.ReadAsync(destination, cancellationToken);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
|
public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|
@ -165,15 +160,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
||||||
return _responseStream.WriteAsync(buffer, offset, count, cancellationToken);
|
return _responseStream.WriteAsync(buffer, offset, count, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
return _responseStream.WriteAsync(source, cancellationToken);
|
return _responseStream.WriteAsync(source, cancellationToken);
|
||||||
}
|
}
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override long Seek(long offset, SeekOrigin origin)
|
public override long Seek(long offset, SeekOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -113,15 +113,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
||||||
// REVIEW: This *could* be slower if 2 things are true
|
// REVIEW: This *could* be slower if 2 things are true
|
||||||
// - The WriteAsync(ReadOnlyMemory<byte>) isn't overridden on the destination
|
// - The WriteAsync(ReadOnlyMemory<byte>) isn't overridden on the destination
|
||||||
// - We change the Kestrel Memory Pool to not use pinned arrays but instead use native memory
|
// - We change the Kestrel Memory Pool to not use pinned arrays but instead use native memory
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
await destination.WriteAsync(memory, cancellationToken);
|
await destination.WriteAsync(memory, cancellationToken);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var array = memory.GetArray();
|
|
||||||
await destination.WriteAsync(array.Array, array.Offset, array.Count, cancellationToken);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#if NETCOREAPP2_1
|
|
||||||
// Adapt to the SslStream signature
|
// Adapt to the SslStream signature
|
||||||
ServerCertificateSelectionCallback selector = null;
|
ServerCertificateSelectionCallback selector = null;
|
||||||
if (_serverCertificateSelector != null)
|
if (_serverCertificateSelector != null)
|
||||||
|
|
@ -172,22 +171,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
await sslStream.AuthenticateAsServerAsync(sslOptions, CancellationToken.None);
|
await sslStream.AuthenticateAsServerAsync(sslOptions, CancellationToken.None);
|
||||||
#elif NETSTANDARD2_0 // No ALPN support
|
|
||||||
var serverCert = _serverCertificate;
|
|
||||||
if (_serverCertificateSelector != null)
|
|
||||||
{
|
|
||||||
context.Features.Set(sslStream);
|
|
||||||
serverCert = _serverCertificateSelector(context.ConnectionContext, null);
|
|
||||||
if (serverCert != null)
|
|
||||||
{
|
|
||||||
EnsureCertificateIsAllowedForServerAuth(serverCert);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await sslStream.AuthenticateAsServerAsync(serverCert, certificateRequired,
|
|
||||||
_options.SslProtocols, _options.CheckCertificateRevocation);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
|
|
@ -206,13 +189,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
||||||
timeoutFeature.CancelTimeout();
|
timeoutFeature.CancelTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
feature.ApplicationProtocol = sslStream.NegotiatedApplicationProtocol.Protocol;
|
feature.ApplicationProtocol = sslStream.NegotiatedApplicationProtocol.Protocol;
|
||||||
context.Features.Set<ITlsApplicationProtocolFeature>(feature);
|
context.Features.Set<ITlsApplicationProtocolFeature>(feature);
|
||||||
#elif NETSTANDARD2_0 // No ALPN support
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
feature.ClientCertificate = ConvertToX509Certificate2(sslStream.RemoteCertificate);
|
feature.ClientCertificate = ConvertToX509Certificate2(sslStream.RemoteCertificate);
|
||||||
feature.CipherAlgorithm = sslStream.CipherAlgorithm;
|
feature.CipherAlgorithm = sslStream.CipherAlgorithm;
|
||||||
feature.CipherStrength = sslStream.CipherStrength;
|
feature.CipherStrength = sslStream.CipherStrength;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -68,13 +68,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
|
||||||
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
=> _inner.ReadAsync(buffer, offset, count, cancellationToken);
|
=> _inner.ReadAsync(buffer, offset, count, cancellationToken);
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
|
||||||
=> _inner.ReadAsync(destination, cancellationToken);
|
=> _inner.ReadAsync(destination, cancellationToken);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override int ReadByte()
|
public override int ReadByte()
|
||||||
=> _inner.ReadByte();
|
=> _inner.ReadByte();
|
||||||
|
|
@ -91,13 +86,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
|
||||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||||
=> _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
=> _inner.WriteAsync(buffer, offset, count, cancellationToken);
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
|
||||||
=> _inner.WriteAsync(source, cancellationToken);
|
=> _inner.WriteAsync(source, cancellationToken);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public override void WriteByte(byte value)
|
public override void WriteByte(byte value)
|
||||||
=> _inner.WriteByte(value);
|
=> _inner.WriteByte(value);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Core components of ASP.NET Core Kestrel cross-platform web server.</Description>
|
<Description>Core components of ASP.NET Core Kestrel cross-platform web server.</Description>
|
||||||
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;kestrel</PackageTags>
|
<PackageTags>aspnetcore;kestrel</PackageTags>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -85,18 +85,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
|
||||||
await Assert.ThrowsAsync<NotSupportedException>(() => stream.WriteAsync(new byte[1], 0, 1));
|
await Assert.ThrowsAsync<NotSupportedException>(() => stream.WriteAsync(new byte[1], 0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NET461
|
|
||||||
[Fact]
|
|
||||||
public void BeginWriteThrows()
|
|
||||||
{
|
|
||||||
var stream = new HttpRequestStream(Mock.Of<IHttpBodyControlFeature>());
|
|
||||||
Assert.Throws<NotSupportedException>(() => stream.BeginWrite(new byte[1], 0, 1, null, null));
|
|
||||||
}
|
|
||||||
#elif NETCOREAPP2_2
|
|
||||||
#else
|
|
||||||
#error Target framework needs to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
// Read-only streams should support Flush according to https://github.com/dotnet/corefx/pull/27327#pullrequestreview-98384813
|
// Read-only streams should support Flush according to https://github.com/dotnet/corefx/pull/27327#pullrequestreview-98384813
|
||||||
public void FlushDoesNotThrow()
|
public void FlushDoesNotThrow()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>ASP.NET Core Kestrel cross-platform web server.</Description>
|
<Description>ASP.NET Core Kestrel cross-platform web server.</Description>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;kestrel</PackageTags>
|
<PackageTags>aspnetcore;kestrel</PackageTags>
|
||||||
<NoWarn>CS1591;$(NoWarn)</NoWarn>
|
<NoWarn>CS1591;$(NoWarn)</NoWarn>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -57,7 +56,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif NET461
|
|
||||||
#else
|
|
||||||
#error Target framework needs to be updated
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Transport abstractions for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
<Description>Transport abstractions for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;kestrel</PackageTags>
|
<PackageTags>aspnetcore;kestrel</PackageTags>
|
||||||
<NoWarn>CS1570;CS1571;CS1572;CS1573;CS1574;CS1591;$(NoWarn)</NoWarn>
|
<NoWarn>CS1570;CS1571;CS1572;CS1573;CS1574;CS1591;$(NoWarn)</NoWarn>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Libuv transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
<Description>Libuv transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;kestrel</PackageTags>
|
<PackageTags>aspnetcore;kestrel</PackageTags>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -15,13 +15,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
|
||||||
|
|
||||||
public SocketAwaitableEventArgs WaitForDataAsync()
|
public SocketAwaitableEventArgs WaitForDataAsync()
|
||||||
{
|
{
|
||||||
#if NETCOREAPP2_1
|
|
||||||
_awaitableEventArgs.SetBuffer(Memory<byte>.Empty);
|
_awaitableEventArgs.SetBuffer(Memory<byte>.Empty);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
_awaitableEventArgs.SetBuffer(Array.Empty<byte>(), 0, 0);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!_socket.ReceiveAsync(_awaitableEventArgs))
|
if (!_socket.ReceiveAsync(_awaitableEventArgs))
|
||||||
{
|
{
|
||||||
|
|
@ -33,15 +27,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
|
||||||
|
|
||||||
public SocketAwaitableEventArgs ReceiveAsync(Memory<byte> buffer)
|
public SocketAwaitableEventArgs ReceiveAsync(Memory<byte> buffer)
|
||||||
{
|
{
|
||||||
#if NETCOREAPP2_1
|
|
||||||
_awaitableEventArgs.SetBuffer(buffer);
|
_awaitableEventArgs.SetBuffer(buffer);
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var segment = buffer.GetArray();
|
|
||||||
|
|
||||||
_awaitableEventArgs.SetBuffer(segment.Array, segment.Offset, segment.Count);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
if (!_socket.ReceiveAsync(_awaitableEventArgs))
|
if (!_socket.ReceiveAsync(_awaitableEventArgs))
|
||||||
{
|
{
|
||||||
_awaitableEventArgs.Complete();
|
_awaitableEventArgs.Complete();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -26,13 +26,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
|
||||||
return SendAsync(buffers.First);
|
return SendAsync(buffers.First);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
if (!_awaitableEventArgs.MemoryBuffer.Equals(Memory<byte>.Empty))
|
if (!_awaitableEventArgs.MemoryBuffer.Equals(Memory<byte>.Empty))
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
if (_awaitableEventArgs.Buffer != null)
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
_awaitableEventArgs.SetBuffer(null, 0, 0);
|
_awaitableEventArgs.SetBuffer(null, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -55,15 +49,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
|
||||||
_awaitableEventArgs.BufferList = null;
|
_awaitableEventArgs.BufferList = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_1
|
|
||||||
_awaitableEventArgs.SetBuffer(MemoryMarshal.AsMemory(memory));
|
_awaitableEventArgs.SetBuffer(MemoryMarshal.AsMemory(memory));
|
||||||
#elif NETSTANDARD2_0
|
|
||||||
var segment = memory.GetArray();
|
|
||||||
|
|
||||||
_awaitableEventArgs.SetBuffer(segment.Array, segment.Offset, segment.Count);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
if (!_socket.SendAsync(_awaitableEventArgs))
|
if (!_socket.SendAsync(_awaitableEventArgs))
|
||||||
{
|
{
|
||||||
_awaitableEventArgs.Complete();
|
_awaitableEventArgs.Complete();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Managed socket transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
<Description>Managed socket transport for the ASP.NET Core Kestrel cross-platform web server.</Description>
|
||||||
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageTags>aspnetcore;kestrel</PackageTags>
|
<PackageTags>aspnetcore;kestrel</PackageTags>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -140,7 +140,6 @@ namespace Microsoft.AspNetCore.Testing
|
||||||
_innerStream.Close();
|
_innerStream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
public override int Read(Span<byte> buffer)
|
public override int Read(Span<byte> buffer)
|
||||||
{
|
{
|
||||||
return _innerStream.Read(buffer);
|
return _innerStream.Read(buffer);
|
||||||
|
|
@ -165,10 +164,6 @@ namespace Microsoft.AspNetCore.Testing
|
||||||
{
|
{
|
||||||
_innerStream.CopyTo(destination, bufferSize);
|
_innerStream.CopyTo(destination, bufferSize);
|
||||||
}
|
}
|
||||||
#elif NET461
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -95,7 +93,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif NET461 // No ALPN support
|
|
||||||
#else
|
|
||||||
#error TFMs need updating
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -146,7 +144,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif NET461 // No ALPN support
|
|
||||||
#else
|
|
||||||
#error TFMs need updating
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Pipelines;
|
using System.IO.Pipelines;
|
||||||
|
|
@ -126,7 +124,3 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.Http2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif NET461 // No ALPN support
|
|
||||||
#else
|
|
||||||
#error TFMs need updating
|
|
||||||
#endif
|
|
||||||
|
|
@ -182,13 +182,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
{
|
{
|
||||||
Assert.NotNull(connection);
|
Assert.NotNull(connection);
|
||||||
Assert.NotNull(connection.Features.Get<SslStream>());
|
Assert.NotNull(connection.Features.Get<SslStream>());
|
||||||
#if NETCOREAPP2_2
|
|
||||||
Assert.Equal("localhost", name);
|
Assert.Equal("localhost", name);
|
||||||
#elif NET461
|
|
||||||
Assert.Null(name);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
selectorCalled++;
|
selectorCalled++;
|
||||||
return _x509Certificate2;
|
return _x509Certificate2;
|
||||||
}
|
}
|
||||||
|
|
@ -224,13 +218,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
{
|
{
|
||||||
Assert.NotNull(connection);
|
Assert.NotNull(connection);
|
||||||
Assert.NotNull(connection.Features.Get<SslStream>());
|
Assert.NotNull(connection.Features.Get<SslStream>());
|
||||||
#if NETCOREAPP2_2
|
|
||||||
Assert.Equal("localhost", name);
|
Assert.Equal("localhost", name);
|
||||||
#elif NET461
|
|
||||||
Assert.Null(name);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
selectorCalled++;
|
selectorCalled++;
|
||||||
if (selectorCalled == 1)
|
if (selectorCalled == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -314,13 +302,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
|
||||||
{
|
{
|
||||||
Assert.NotNull(connection);
|
Assert.NotNull(connection);
|
||||||
Assert.NotNull(connection.Features.Get<SslStream>());
|
Assert.NotNull(connection.Features.Get<SslStream>());
|
||||||
#if NETCOREAPP2_2
|
|
||||||
Assert.Equal("localhost", name);
|
Assert.Equal("localhost", name);
|
||||||
#elif NET461
|
|
||||||
Assert.Null(name);
|
|
||||||
#else
|
|
||||||
#error TFMs need to be updated
|
|
||||||
#endif
|
|
||||||
selectorCalled++;
|
selectorCalled++;
|
||||||
return _x509Certificate2;
|
return _x509Certificate2;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TestGroupName>InMemory.FunctionalTests</TestGroupName>
|
<TestGroupName>InMemory.FunctionalTests</TestGroupName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
#if NETCOREAPP2_2
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
@ -135,8 +133,3 @@ namespace Interop.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif NET461 // No ALPN support
|
|
||||||
#else
|
|
||||||
#error TFMs need updating
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TestGroupName>Interop.FunctionalTests</TestGroupName>
|
<TestGroupName>Interop.FunctionalTests</TestGroupName>
|
||||||
<WarningsNotAsErrors>CS8002;$(WarningsNotAsErrors)</WarningsNotAsErrors>
|
<WarningsNotAsErrors>CS8002;$(WarningsNotAsErrors)</WarningsNotAsErrors>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TestGroupName>Libuv.BindTests</TestGroupName>
|
<TestGroupName>Libuv.BindTests</TestGroupName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
|
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<!-- Put this project into its own test group to avoid running parallel with other test projects. Libuv does not play nice with other test assemblies. -->
|
<!-- Put this project into its own test group to avoid running parallel with other test projects. Libuv does not play nice with other test assemblies. -->
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TestGroupName>Sockets.BindTests</TestGroupName>
|
<TestGroupName>Sockets.BindTests</TestGroupName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
|
<DefineConstants Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(DefineConstants);MACOS</DefineConstants>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TestGroupName>Sockets.FunctionalTests</TestGroupName>
|
<TestGroupName>Sockets.FunctionalTests</TestGroupName>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue