Skip to content

Commit f908247

Browse files
authored
Allow use of a default MemoryPoolFeature on ConnectionContext (#18579)
1 parent 5508e76 commit f908247

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Servers/Kestrel/Core/src/Middleware/Http3ConnectionMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public Task OnConnectionAsync(MultiplexedConnectionContext connectionContext)
3131
ConnectionContext = connectionContext,
3232
ServiceContext = _serviceContext,
3333
ConnectionFeatures = connectionContext.Features,
34-
MemoryPool = memoryPoolFeature.MemoryPool,
34+
MemoryPool = memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool<byte>.Shared,
3535
LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint,
3636
RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint
3737
};

src/Servers/Kestrel/Core/src/Middleware/HttpConnectionMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public Task OnConnectionAsync(ConnectionContext connectionContext)
3333
Protocols = _protocols,
3434
ServiceContext = _serviceContext,
3535
ConnectionFeatures = connectionContext.Features,
36-
MemoryPool = memoryPoolFeature.MemoryPool,
36+
MemoryPool = memoryPoolFeature?.MemoryPool ?? System.Buffers.MemoryPool<byte>.Shared,
3737
Transport = connectionContext.Transport,
3838
LocalEndPoint = connectionContext.LocalEndPoint as IPEndPoint,
3939
RemoteEndPoint = connectionContext.RemoteEndPoint as IPEndPoint

0 commit comments

Comments
 (0)