Skip to content

Commit 1e19c6f

Browse files
authored
Use zero byte reads for incoming TLS frames (#30863)
- We recently did some work to reduce the amount of memory allocated by SslStream on idle reads so take advantage of it here by using a new StreamPipeReader feature that makes zero byte reads on the underlying Stream.
1 parent 6179b12 commit 1e19c6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ private SslDuplexPipe CreateSslDuplexPipe(IDuplexPipe transport, MemoryPool<byte
411411
pool: memoryPool,
412412
bufferSize: memoryPool.GetMinimumSegmentSize(),
413413
minimumReadSize: memoryPool.GetMinimumAllocSize(),
414-
leaveOpen: true
414+
leaveOpen: true,
415+
useZeroByteReads: true
415416
);
416417

417418
var outputPipeOptions = new StreamPipeWriterOptions

0 commit comments

Comments
 (0)