We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cd68bc commit 001172fCopy full SHA for 001172f
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs
@@ -686,8 +686,16 @@ private async ValueTask<int> EnsureFullTlsFrameAsync<TIOAdapter>(CancellationTok
686
687
if (frameSize < int.MaxValue)
688
{
689
+ // make sure we have space for the whole frame
690
_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength);
691
}
692
+ else
693
+ {
694
+ // move existing data to the beginning of the buffer (they will
695
+ // be couple of bytes only, otherwise we would have entire
696
+ // header and know exact size)
697
+ _buffer.EnsureAvailableSpace(_buffer.Capacity - _buffer.EncryptedLength);
698
+ }
699
700
while (_buffer.EncryptedLength < frameSize)
701
0 commit comments