mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-10 19:04:07 +00:00
limit access to response stream
This commit is contained in:
parent
c035f2baa1
commit
a855864207
5 changed files with 32 additions and 56 deletions
|
|
@ -77,16 +77,6 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
|
|||
get { return _response.OutputStream; }
|
||||
}
|
||||
|
||||
public void Write(string text)
|
||||
{
|
||||
var bOutput = System.Text.Encoding.UTF8.GetBytes(text);
|
||||
_response.ContentLength64 = bOutput.Length;
|
||||
|
||||
var outputStream = _response.OutputStream;
|
||||
outputStream.Write(bOutput, 0, bOutput.Length);
|
||||
Close();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (!this.IsClosed)
|
||||
|
|
@ -108,8 +98,10 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
|
|||
{
|
||||
try
|
||||
{
|
||||
response.OutputStream.Flush();
|
||||
response.OutputStream.Dispose();
|
||||
var outputStream = response.OutputStream;
|
||||
|
||||
outputStream.Flush();
|
||||
outputStream.Dispose();
|
||||
response.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -118,11 +110,6 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
|
|||
}
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
_response.OutputStream.Flush();
|
||||
}
|
||||
|
||||
public bool IsClosed
|
||||
{
|
||||
get;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue