Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 00fcaf8

Browse files
authored
Delete faulty assert in SslStreamInternal (#29131)
We're hitting an assert when a ReadAsync call is made on SslStream after the underlying stream encounters EOF. When calling FillBufferAsync, we've already allocated the read buffer, and we may not have any data in the buffer; if we then hit EOF, we've still not got any data in the buffer and we return. Then when ReadAsync is called again, the assert trips over the buffer being allocated and also being empty. This just deletes the assert. We could also return the buffer when we hit EOF, but that'll be done by Dispose, anyway.
1 parent 3f97e48 commit 00fcaf8

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ internal Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken
182182
private void ResetReadBuffer()
183183
{
184184
Debug.Assert(_decryptedBytesCount == 0);
185-
Debug.Assert(_internalBuffer == null || _internalBufferCount > 0);
186185

187186
if (_internalBuffer == null)
188187
{

0 commit comments

Comments
 (0)