Allow use of a default MemoryPoolFeature on ConnectionContext (#18579)

This commit is contained in:
Ninds 2020-05-15 22:42:52 +01:00 committed by GitHub
parent 5508e7661c
commit f908247222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
ConnectionContext = connectionContext, ConnectionContext = connectionContext,
ServiceContext = _serviceContext, ServiceContext = _serviceContext,
ConnectionFeatures = connectionContext.Features, ConnectionFeatures = connectionContext.Features,
MemoryPool = memoryPoolFeature.MemoryPool, MemoryPool = memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool<byte>.Shared,
LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint, LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint,
RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint
}; };

View File

@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
Protocols = _protocols, Protocols = _protocols,
ServiceContext = _serviceContext, ServiceContext = _serviceContext,
ConnectionFeatures = connectionContext.Features, ConnectionFeatures = connectionContext.Features,
MemoryPool = memoryPoolFeature.MemoryPool, MemoryPool = memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool<byte>.Shared,
Transport = connectionContext.Transport, Transport = connectionContext.Transport,
LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint, LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint,
RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint