Commit 487b8912 authored by justcoding121's avatar justcoding121 Committed by justcoding121

fix binary reader

parent 04539fb8
...@@ -10,7 +10,7 @@ namespace Titanium.HTTPProxyServer ...@@ -10,7 +10,7 @@ namespace Titanium.HTTPProxyServer
public class CustomBinaryReader : BinaryReader public class CustomBinaryReader : BinaryReader
{ {
public CustomBinaryReader(Stream stream, Encoding encoding) public CustomBinaryReader(Stream stream, Encoding encoding)
: base(stream, encoding) : base(stream, encoding)
...@@ -20,13 +20,10 @@ namespace Titanium.HTTPProxyServer ...@@ -20,13 +20,10 @@ namespace Titanium.HTTPProxyServer
public string ReadLine() public string ReadLine()
{ {
char[] buf = new char[1];
StringBuilder _readBuffer = new StringBuilder();
try try
{ {
char[] buf = new char[1];
StringBuilder _readBuffer = new StringBuilder();
var charsRead = 0; var charsRead = 0;
char lastChar = new char(); char lastChar = new char();
...@@ -48,7 +45,11 @@ namespace Titanium.HTTPProxyServer ...@@ -48,7 +45,11 @@ namespace Titanium.HTTPProxyServer
} }
return _readBuffer.ToString(); return _readBuffer.ToString();
} }
catch { throw new EndOfStreamException(); } catch (IOException)
{ return _readBuffer.ToString(); }
catch (Exception e)
{ throw e; }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment