diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-19 15:11:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-19 15:11:50 -0500 |
| commit | 55538764fa06a64795c099fc6496df9dbb4156bd (patch) | |
| tree | 8c1f94861ecebdf634b70a7265945b6f8f13aff1 /SocketHttpListener/Net/ChunkStream.cs | |
| parent | 3b52035ee064a5d9aa215d9515211d4508585d39 (diff) | |
| parent | c5430f86b0b5863482e7c4f7e55a79c7d88c133b (diff) | |
Merge pull request #575 from EraYaN/reformat
Reformat all C# server code to conform with code standards
Diffstat (limited to 'SocketHttpListener/Net/ChunkStream.cs')
| -rw-r--r-- | SocketHttpListener/Net/ChunkStream.cs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/SocketHttpListener/Net/ChunkStream.cs b/SocketHttpListener/Net/ChunkStream.cs index 5cc01614f..3836947d4 100644 --- a/SocketHttpListener/Net/ChunkStream.cs +++ b/SocketHttpListener/Net/ChunkStream.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -109,7 +108,7 @@ namespace SocketHttpListener.Net var chunksForRemoving = new List<Chunk>(count); for (int i = 0; i < count; i++) { - Chunk chunk = _chunks[i]; + var chunk = _chunks[i]; if (chunk.Offset == chunk.Bytes.Length) { @@ -181,10 +180,7 @@ namespace SocketHttpListener.Net InternalWrite(buffer, ref offset, size); } - public bool WantMore - { - get { return (_chunkRead != _chunkSize || _chunkSize != 0 || _state != State.None); } - } + public bool WantMore => (_chunkRead != _chunkSize || _chunkSize != 0 || _state != State.None); public bool DataAvailable { @@ -193,7 +189,7 @@ namespace SocketHttpListener.Net int count = _chunks.Count; for (int i = 0; i < count; i++) { - Chunk ch = _chunks[i]; + var ch = _chunks[i]; if (ch == null || ch.Bytes == null) continue; if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length) @@ -203,15 +199,9 @@ namespace SocketHttpListener.Net } } - public int TotalDataSize - { - get { return _totalWritten; } - } + public int TotalDataSize => _totalWritten; - public int ChunkLeft - { - get { return _chunkSize - _chunkRead; } - } + public int ChunkLeft => _chunkSize - _chunkRead; private State ReadBody(byte[] buffer, ref int offset, int size) { @@ -378,7 +368,7 @@ namespace SocketHttpListener.Net return State.Trailer; } - StringReader reader = new StringReader(_saved.ToString()); + var reader = new StringReader(_saved.ToString()); string line; while ((line = reader.ReadLine()) != null && line != "") _headers.Add(line); @@ -388,7 +378,7 @@ namespace SocketHttpListener.Net private static void ThrowProtocolViolation(string message) { - WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null); + var we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null); throw we; } } |
