From 79234795fd28c413f4a7d973a64a16ac7d6bd939 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 3 Dec 2018 10:17:22 +0000 Subject: avoid a data copy --- .../Framework/Servers/HttpServer/OSHttpResponse.cs | 36 ++++++++++++++++++++++ .../Servers/HttpServer/PollServiceHttpRequest.cs | 8 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs index b26321b..39d9b13 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs @@ -195,6 +195,42 @@ namespace OpenSim.Framework.Servers.HttpServer } } + public byte[] RawBuffer + { + get + { + return _httpResponse.RawBuffer; + } + set + { + _httpResponse.RawBuffer = value; + } + } + + public int RawBufferStart + { + get + { + return _httpResponse.RawBufferStart; + } + set + { + _httpResponse.RawBufferStart = value; + } + } + + public int RawBufferLen + { + get + { + return _httpResponse.RawBufferLen; + } + set + { + _httpResponse.RawBufferLen = value; + } + } + /// /// Set a redirct location. /// diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index 66fd2c6..47a0b9c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs @@ -206,11 +206,17 @@ namespace OpenSim.Framework.Servers.HttpServer try { if(rangeLen > 0) - response.OutputStream.Write(buffer, rangeStart, rangeLen); + { + response.RawBufferStart = rangeStart; + response.RawBufferLen = rangeLen; + response.RawBuffer = buffer; + //response.OutputStream.Write(buffer, rangeStart, rangeLen); + } buffer = null; response.Send(); + response.RawBuffer = null; } catch (Exception ex) { -- cgit v1.1