diff options
| author | Tthecreator <epostvanthomas@kpnmail.nl> | 2019-01-22 15:22:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 15:22:42 +0000 |
| commit | 189b99df16bd4c93cc96422d7282d01d9ff5b82f (patch) | |
| tree | 26d7da95fe3e3b2772b8b39a2463a6c0ac7652fc /SocketHttpListener/Net/ChunkedInputStream.cs | |
| parent | a00c0defa8cb22774f5dc8a7d566eb36ac7307e8 (diff) | |
| parent | edcfd8b565f632088c8b1f826db8e2fbecf9790d (diff) | |
Merge pull request #1 from jellyfin/dev
Update from jellyfin repo
Diffstat (limited to 'SocketHttpListener/Net/ChunkedInputStream.cs')
| -rw-r--r-- | SocketHttpListener/Net/ChunkedInputStream.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/SocketHttpListener/Net/ChunkedInputStream.cs b/SocketHttpListener/Net/ChunkedInputStream.cs index 4d6d96a6c..7aa8529e3 100644 --- a/SocketHttpListener/Net/ChunkedInputStream.cs +++ b/SocketHttpListener/Net/ChunkedInputStream.cs @@ -1,8 +1,6 @@ using System; using System.IO; using System.Net; -using System.Runtime.InteropServices; -using SocketHttpListener.Primitives; namespace SocketHttpListener.Net { @@ -63,14 +61,14 @@ namespace SocketHttpListener.Net : base(stream, buffer, offset, length) { _context = context; - WebHeaderCollection coll = (WebHeaderCollection)context.Request.Headers; + var coll = (WebHeaderCollection)context.Request.Headers; _decoder = new ChunkStream(coll); } public ChunkStream Decoder { - get { return _decoder; } - set { _decoder = value; } + get => _decoder; + set => _decoder = value; } protected override int ReadCore(byte[] buffer, int offset, int count) @@ -81,7 +79,7 @@ namespace SocketHttpListener.Net protected override IAsyncResult BeginReadCore(byte[] buffer, int offset, int size, AsyncCallback cback, object state) { - HttpStreamAsyncResult ares = new HttpStreamAsyncResult(this); + var ares = new HttpStreamAsyncResult(this); ares._callback = cback; ares._state = state; if (_no_more_data || size == 0 || _closed) @@ -109,7 +107,7 @@ namespace SocketHttpListener.Net ares._buffer = new byte[8192]; ares._offset = 0; ares._count = 8192; - ReadBufferState rb = new ReadBufferState(buffer, offset, size, ares); + var rb = new ReadBufferState(buffer, offset, size, ares); rb.InitialCount += nread; base.BeginReadCore(ares._buffer, ares._offset, ares._count, OnRead, rb); return ares; @@ -118,7 +116,7 @@ namespace SocketHttpListener.Net private void OnRead(IAsyncResult base_ares) { ReadBufferState rb = (ReadBufferState)base_ares.AsyncState; - HttpStreamAsyncResult ares = rb.Ares; + var ares = rb.Ares; try { int nread = base.EndRead(base_ares); @@ -157,7 +155,7 @@ namespace SocketHttpListener.Net if (asyncResult == null) throw new ArgumentNullException(nameof(asyncResult)); - HttpStreamAsyncResult ares = asyncResult as HttpStreamAsyncResult; + var ares = asyncResult as HttpStreamAsyncResult; if (ares == null || !ReferenceEquals(this, ares._parent)) { throw new ArgumentException("Invalid async result"); |
