mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-28 13:21:19 +00:00
consolidate web socket onto one port
This commit is contained in:
parent
ea559a6e27
commit
bc657237aa
20 changed files with 1900 additions and 478 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Implementations.HttpServer.SocketSharp;
|
||||
using ServiceStack;
|
||||
using ServiceStack.Web;
|
||||
using System;
|
||||
|
|
@ -66,13 +67,23 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
|
||||
if (length > 0)
|
||||
{
|
||||
var response = (HttpListenerResponse)res.OriginalResponse;
|
||||
res.SetContentLength(length);
|
||||
|
||||
var listenerResponse = res.OriginalResponse as HttpListenerResponse;
|
||||
|
||||
response.ContentLength64 = length;
|
||||
|
||||
// Disable chunked encoding. Technically this is only needed when using Content-Range, but
|
||||
// anytime we know the content length there's no need for it
|
||||
response.SendChunked = false;
|
||||
if (listenerResponse != null)
|
||||
{
|
||||
// Disable chunked encoding. Technically this is only needed when using Content-Range, but
|
||||
// anytime we know the content length there's no need for it
|
||||
listenerResponse.SendChunked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var sharpResponse = res as WebSocketSharpResponse;
|
||||
if (sharpResponse != null)
|
||||
{
|
||||
sharpResponse.SendChunked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue