Skip to content

Commit

Permalink
quick return instead of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
gusarov committed Feb 16, 2020
1 parent 86c88f8 commit db3ddf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/River.HttpWrap/HttpWrapClientStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private int ReceiveHttp(Stream stream, byte[] buf, int pos, int cnt)
var c = stream.Read(_readBuf, _readTo, _readBuf.Length - _readTo);
if (c == 0)
{
return 0;
throw new ConnectionClosingException();
}
_readTo += c;
Expand Down
1 change: 1 addition & 0 deletions src/River.HttpWrap/HttpWrapHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private int Unwrap(Stream stream, byte[] buf, int pos, int cnt)
var c = stream.Read(_readBuf, _readTo, _readBuf.Length - _readTo);
if (c == 0)
{
return 0;
throw new ConnectionClosingException();
}
_readTo += c;
Expand Down

0 comments on commit db3ddf0

Please sign in to comment.