Don't set status code if response is closed

This commit is contained in:
Claus Vium
2019-03-07 22:26:23 +01:00
parent 10a0d6bdba
commit 3fa43a1e08
6 changed files with 19 additions and 50 deletions

View File

@@ -225,7 +225,7 @@ namespace Emby.Server.Implementations.HttpServer
var httpRes = httpReq.Response;
if (httpRes.IsClosed)
if (httpRes.OriginalResponse.HasStarted)
{
return;
}
@@ -595,8 +595,6 @@ namespace Emby.Server.Implementations.HttpServer
}
finally
{
// TODO response closes automatically after the handler is done, but some functions rely on knowing if it's closed or not
httpRes.IsClosed = true;
stopWatch.Stop();
var elapsed = stopWatch.Elapsed;
if (elapsed.TotalMilliseconds > 500)