From 228e1b59a2fc24c2e4ce57aa8171a13a1a18c199 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 8 Apr 2023 16:09:51 -0400 Subject: Minor updates and API changes --- lib/Net.Http/src/Helpers/TransportReader.cs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'lib/Net.Http/src/Helpers') diff --git a/lib/Net.Http/src/Helpers/TransportReader.cs b/lib/Net.Http/src/Helpers/TransportReader.cs index a37bfe9..722120b 100644 --- a/lib/Net.Http/src/Helpers/TransportReader.cs +++ b/lib/Net.Http/src/Helpers/TransportReader.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Net.Http @@ -29,7 +29,6 @@ using System.Text; using VNLib.Utils; using VNLib.Utils.IO; - namespace VNLib.Net.Http.Core { @@ -39,18 +38,14 @@ namespace VNLib.Net.Http.Core internal struct TransportReader : IVnTextReader { /// - public readonly Encoding Encoding => _encoding; + public readonly Encoding Encoding { get; } /// - public readonly ReadOnlyMemory LineTermination => _lineTermination; + public readonly ReadOnlyMemory LineTermination { get; } /// - public readonly Stream BaseStream => _transport; - + public readonly Stream BaseStream { get; } private readonly SharedHeaderReaderBuffer BinBuffer; - private readonly Encoding _encoding; - private readonly Stream _transport; - private readonly ReadOnlyMemory _lineTermination; - + private int BufWindowStart; private int BufWindowEnd; @@ -65,9 +60,9 @@ namespace VNLib.Net.Http.Core { BufWindowEnd = 0; BufWindowStart = 0; - _encoding = encoding; - _transport = transport; - _lineTermination = lineTermination; + Encoding = encoding; + BaseStream = transport; + LineTermination = lineTermination; BinBuffer = buffer; } @@ -86,7 +81,7 @@ namespace VNLib.Net.Http.Core //Get a buffer from the end of the current window to the end of the buffer Span bufferWindow = BinBuffer.BinBuffer[BufWindowEnd..]; //Read from stream - int read = _transport.Read(bufferWindow); + int read = BaseStream.Read(bufferWindow); //Update the end of the buffer window to the end of the read data BufWindowEnd += read; } -- cgit