aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/ChunkedInputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'SocketHttpListener/Net/ChunkedInputStream.cs')
-rw-r--r--SocketHttpListener/Net/ChunkedInputStream.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/SocketHttpListener/Net/ChunkedInputStream.cs b/SocketHttpListener/Net/ChunkedInputStream.cs
index cdf7ac649..8d59a7907 100644
--- a/SocketHttpListener/Net/ChunkedInputStream.cs
+++ b/SocketHttpListener/Net/ChunkedInputStream.cs
@@ -61,7 +61,7 @@ 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);
}
@@ -73,13 +73,13 @@ namespace SocketHttpListener.Net
protected override int ReadCore(byte[] buffer, int offset, int count)
{
- IAsyncResult ares = BeginReadCore(buffer, offset, count, null, null);
+ var ares = BeginReadCore(buffer, offset, count, null, null);
return EndRead(ares);
}
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)
@@ -107,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;
@@ -115,8 +115,8 @@ namespace SocketHttpListener.Net
private void OnRead(IAsyncResult base_ares)
{
- ReadBufferState rb = (ReadBufferState)base_ares.AsyncState;
- HttpStreamAsyncResult ares = rb.Ares;
+ var rb = (ReadBufferState)base_ares.AsyncState;
+ var ares = rb.Ares;
try
{
int nread = base.EndRead(base_ares);
@@ -155,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");