Unverified Commit af550aaf authored by Jehonathan Thomas's avatar Jehonathan Thomas Committed by GitHub

Merge pull request #546 from nirbil/patch-1

fix buffers returned to pool too early
parents a7d4c61f 74207225
...@@ -67,11 +67,15 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -67,11 +67,15 @@ namespace Titanium.Web.Proxy.Helpers
idx += newLineChars; idx += newLineChars;
} }
return stream.WriteAsync(buffer, 0, idx, cancellationToken); return stream.WriteAsync(buffer, 0, idx, cancellationToken).ContinueWith((antecedent) =>
{
bufferPool.ReturnBuffer(buffer);
});
} }
finally catch(Exception ex)
{ {
bufferPool.ReturnBuffer(buffer); bufferPool.ReturnBuffer(buffer);
throw ex;
} }
} }
else else
......
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