Skip to content

Commit

Permalink
Close input bytestream even in request with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jkb0o committed Jun 15, 2015
1 parent d548282 commit e4c2975
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ private void GetResponse() {
isDone = true;
responseTime = curcall.ElapsedMilliseconds;

if ( byteStream != null )
{
byteStream.Close();
}

if ( completedCallback != null )
{
if (synchronous) {
Expand Down Expand Up @@ -358,7 +363,6 @@ void WriteToStream( Stream outputStream )
stream.Write(buffer, 0, readed);
numBytesToRead -= readed;
}
byteStream.Close();
}

private static string[] sizes = { "B", "KB", "MB", "GB" };
Expand Down

0 comments on commit e4c2975

Please sign in to comment.