better source stream disposal for static files

This commit is contained in:
LukePulverenti 2013-03-09 01:05:19 -05:00
parent ca5acb6edc
commit 2828688ced

View File

@ -40,9 +40,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// </summary>
/// <param name="responseStream">The response stream.</param>
/// <returns>Task.</returns>
private Task WriteToAsync(Stream responseStream)
private async Task WriteToAsync(Stream responseStream)
{
return SourceStream.CopyToAsync(responseStream);
using (var src = SourceStream)
{
await src.CopyToAsync(responseStream).ConfigureAwait(false);
}
}
}
}