Skip to content

Commit db3ddf0

Browse files
committed
quick return instead of exception
1 parent 86c88f8 commit db3ddf0

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/River.HttpWrap/HttpWrapClientStream.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ private int ReceiveHttp(Stream stream, byte[] buf, int pos, int cnt)
136136
var c = stream.Read(_readBuf, _readTo, _readBuf.Length - _readTo);
137137
if (c == 0)
138138
{
139+
return 0;
139140
throw new ConnectionClosingException();
140141
}
141142
_readTo += c;

src/River.HttpWrap/HttpWrapHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ private int Unwrap(Stream stream, byte[] buf, int pos, int cnt)
4343
var c = stream.Read(_readBuf, _readTo, _readBuf.Length - _readTo);
4444
if (c == 0)
4545
{
46+
return 0;
4647
throw new ConnectionClosingException();
4748
}
4849
_readTo += c;

0 commit comments

Comments
 (0)