46 references to _buffer
System.Net.Security (46)
System\Net\Security\SslStream.cs (3)
754if (_buffer.DecryptedLength > 0) 756int b = _buffer.DecryptedSpan[0]; 757_buffer.Discard(1);
System\Net\Security\SslStream.IO.cs (43)
68_buffer.ReturnBuffer(); 71if (!_buffer.IsValid) 217if (_buffer.ActiveLength > 0) 265if (_buffer.ActiveLength == 0) 267_buffer.ReturnBuffer(); 328_buffer.EnsureAvailableSpace(InitialHandshakeBufferSize); 424if (TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame)) 431if (!_isRenego && _buffer.EncryptedReadOnlySpan[_lastFrame.Header.Version == SslProtocols.Ssl2 ? HandshakeTypeOffsetSsl2 : HandshakeTypeOffsetTls] == (byte)TlsHandshakeType.ClientHello && 446if (!TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame, options)) 492ReadOnlySpan<byte> availableData = _buffer.EncryptedReadOnlySpan; 495while (_buffer.EncryptedLength - chunkSize > TlsFrameHelper.HeaderSize) 518_buffer.DiscardEncrypted(consumed); 719if (_buffer.ActiveLength == 0) 721_buffer.ReturnBuffer(); 727frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan); 728return _buffer.EncryptedLength >= frameSize; 745_buffer.EnsureAvailableSpace(frameSize == UnknownTlsFrameLength ? 747frameSize - _buffer.EncryptedLength); 749while (_buffer.EncryptedLength < frameSize) 752Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0"); 755int bytesRead = await TIOAdapter.ReadAsync(InnerStream, _buffer.AvailableMemory, cancellationToken).ConfigureAwait(false); 758if (_buffer.EncryptedLength != 0) 767_buffer.Commit(bytesRead); 768if (frameSize == int.MaxValue && _buffer.EncryptedLength > TlsFrameHelper.HeaderSize) 771frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan); 772_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength); 788status = Decrypt(_buffer.EncryptedSpanSliced(frameSize), out int decryptedOffset, out int decryptedCount); 789_buffer.OnDecrypted(decryptedOffset, decryptedCount, frameSize); 839if (_buffer.DecryptedLength != 0) 854Debug.Assert(_buffer.EncryptedLength == 0); 859Debug.Assert(_buffer.DecryptedLength == 0); 874if (_buffer.DecryptedLength != 0) 876extraBuffer = new byte[_buffer.DecryptedLength]; 877_buffer.DecryptedSpan.CopyTo(extraBuffer); 879_buffer.Discard(_buffer.DecryptedLength); 905if (_buffer.DecryptedLength > 0) 932TlsFrameHelper.TryGetFrameHeader(_buffer.EncryptedReadOnlySpan, ref _lastFrame.Header); 999Debug.Assert(_buffer.DecryptedLength > 0); 1001int copyBytes = Math.Min(_buffer.DecryptedLength, buffer.Length); 1004_buffer.DecryptedReadOnlySpanSliced(copyBytes).CopyTo(buffer.Span); 1005_buffer.Discard(copyBytes);