Implement IOSHttpRequest and IOSHttpResponse http interfaces and use instead of OSHttpRequest/OSHttpResponse.
This is required for the substitution of different HTTP servers or the newer HttpServer.dll without having to commit to a particular implementation. This is also required to write regression tests that involve the HTTP layer. If you need to recompile, all you need to do is replace OSHttpRequest/OSHttpResponse references with IOSHttpRequest/IOSHttpResponse.iar_mods
parent
37889eb3fa
commit
4567555c49
|
@ -41,7 +41,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
{
|
||||
#region GET methods
|
||||
public string GetHandler(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
|
@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
}
|
||||
}
|
||||
|
||||
public string GetHandlerRegions(OSHttpResponse httpResponse)
|
||||
public string GetHandlerRegions(IOSHttpResponse httpResponse)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
|
@ -95,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
return rxw.ToString();
|
||||
}
|
||||
|
||||
public string GetHandlerRegion(OSHttpResponse httpResponse, string param)
|
||||
public string GetHandlerRegion(IOSHttpResponse httpResponse, string param)
|
||||
{
|
||||
// be resilient and don't get confused by a terminating '/'
|
||||
param = param.TrimEnd(new char[]{'/'});
|
||||
|
@ -180,7 +180,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
}
|
||||
#endregion GET methods
|
||||
|
||||
protected string RegionTerrain(OSHttpResponse httpResponse, Scene scene)
|
||||
protected string RegionTerrain(IOSHttpResponse httpResponse, Scene scene)
|
||||
{
|
||||
httpResponse.SendChunked = true;
|
||||
httpResponse.ContentType = "text/xml";
|
||||
|
@ -190,7 +190,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
// "GET", "terrain not implemented");
|
||||
}
|
||||
|
||||
protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
|
||||
protected string RegionStats(IOSHttpResponse httpResponse, Scene scene)
|
||||
{
|
||||
int users = scene.GetRootAgentCount();
|
||||
int objects = scene.Entities.Count - users;
|
||||
|
@ -213,7 +213,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
return rxw.ToString();
|
||||
}
|
||||
|
||||
protected string RegionPrims(OSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max)
|
||||
protected string RegionPrims(IOSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max)
|
||||
{
|
||||
httpResponse.SendChunked = true;
|
||||
httpResponse.ContentType = "text/xml";
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
{
|
||||
#region GET methods
|
||||
public string GetRegionInfoHandler(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
|
@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
}
|
||||
}
|
||||
|
||||
public string GetRegionInfoHandlerRegions(OSHttpResponse httpResponse)
|
||||
public string GetRegionInfoHandlerRegions(IOSHttpResponse httpResponse)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
#region POST methods
|
||||
|
||||
public string PostHandler(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
|
@ -92,7 +92,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
}
|
||||
}
|
||||
|
||||
public string CreateRegion(OSHttpRequest request, OSHttpResponse response)
|
||||
public string CreateRegion(IOSHttpRequest request, IOSHttpResponse response)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
|
@ -108,7 +108,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
|||
return rxw.ToString();
|
||||
}
|
||||
|
||||
public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
|
||||
public string LoadPrims(string requestBody, IOSHttpRequest request, IOSHttpResponse response, Scene scene)
|
||||
{
|
||||
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
|
|
|
@ -328,7 +328,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
|||
/// </summary>
|
||||
/// <param name="request">HTTP request header</param>
|
||||
/// <returns>true when the HTTP request came from god.</returns>
|
||||
protected bool IsGod(OSHttpRequest request)
|
||||
protected bool IsGod(IOSHttpRequest request)
|
||||
{
|
||||
string[] keys = request.Headers.GetValues("X-OpenSim-Godkey");
|
||||
if (null == keys) return false;
|
||||
|
@ -342,7 +342,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
|||
/// HTTP header is indeed the password on file for the avatar
|
||||
/// specified by the UUID
|
||||
/// </summary>
|
||||
protected bool IsVerifiedUser(OSHttpRequest request, UUID uuid)
|
||||
protected bool IsVerifiedUser(IOSHttpRequest request, UUID uuid)
|
||||
{
|
||||
// XXX under construction
|
||||
return false;
|
||||
|
@ -377,7 +377,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
|||
/// <param name="message">failure message</param>
|
||||
/// <remarks>This should probably set a return code as
|
||||
/// well. (?)</remarks>
|
||||
protected string Failure(OSHttpResponse response, OSHttpStatusCode status,
|
||||
protected string Failure(IOSHttpResponse response, OSHttpStatusCode status,
|
||||
string method, string format, params string[] msg)
|
||||
{
|
||||
string m = String.Format(format, msg);
|
||||
|
@ -396,7 +396,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
|||
/// <param name="e">exception causing the failure message</param>
|
||||
/// <remarks>This should probably set a return code as
|
||||
/// well. (?)</remarks>
|
||||
public string Failure(OSHttpResponse response, OSHttpStatusCode status,
|
||||
public string Failure(IOSHttpResponse response, OSHttpStatusCode status,
|
||||
string method, Exception e)
|
||||
{
|
||||
string m = String.Format("exception occurred: {0}", e.Message);
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Capabilities.Handlers
|
|||
m_assetService = assService;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// Try to parse the texture ID from the request URL
|
||||
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
||||
|
@ -127,7 +127,7 @@ namespace OpenSim.Capabilities.Handlers
|
|||
/// <param name="textureID"></param>
|
||||
/// <param name="format"></param>
|
||||
/// <returns>False for "caller try another codec"; true otherwise</returns>
|
||||
private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format)
|
||||
private bool FetchTexture(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID textureID, string format)
|
||||
{
|
||||
// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
|
||||
AssetBase texture;
|
||||
|
@ -211,7 +211,7 @@ namespace OpenSim.Capabilities.Handlers
|
|||
return true;
|
||||
}
|
||||
|
||||
private void WriteTextureData(OSHttpRequest request, OSHttpResponse response, AssetBase texture, string format)
|
||||
private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format)
|
||||
{
|
||||
string range = request.Headers.GetOne("Range");
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace OpenSim.Capabilities.Handlers
|
|||
/// <param name="httpResponse"></param>
|
||||
/// <returns>The upload response if the request is successful, null otherwise.</returns>
|
||||
public string UploadBakedTexture(
|
||||
string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Capabilities.Handlers
|
|||
m_LibraryService = libService;
|
||||
}
|
||||
|
||||
public string FetchInventoryDescendentsRequest(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// lock (m_fetchLock)
|
||||
// {
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace OpenSim.Framework.Capabilities
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
//Encoding encoding = Util.UTF8;
|
||||
//StreamReader streamReader = new StreamReader(request, false);
|
||||
|
|
|
@ -600,7 +600,7 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
}
|
||||
|
||||
public string StatReport(OSHttpRequest httpRequest)
|
||||
public string StatReport(IOSHttpRequest httpRequest)
|
||||
{
|
||||
// If we catch a request for "callback", wrap the response in the value for jsonp
|
||||
if (httpRequest.Query.ContainsKey("callback"))
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler
|
||||
{
|
||||
public abstract byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse);
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
|
||||
|
||||
protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
private BinaryMethod m_method;
|
||||
|
||||
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] data = ReadFully(request);
|
||||
string param = GetParam(path);
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public interface IOSHttpRequest
|
||||
{
|
||||
string[] AcceptTypes { get; }
|
||||
Encoding ContentEncoding { get; }
|
||||
long ContentLength { get; }
|
||||
long ContentLength64 { get; }
|
||||
string ContentType { get; }
|
||||
HttpCookieCollection Cookies { get; }
|
||||
bool HasEntityBody { get; }
|
||||
NameValueCollection Headers { get; }
|
||||
string HttpMethod { get; }
|
||||
Stream InputStream { get; }
|
||||
bool IsSecured { get; }
|
||||
bool KeepAlive { get; }
|
||||
NameValueCollection QueryString { get; }
|
||||
Hashtable Query { get; }
|
||||
string RawUrl { get; }
|
||||
IPEndPoint RemoteIPEndPoint { get; }
|
||||
Uri Url { get; }
|
||||
string UserAgent { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public interface IOSHttpResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Content type property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Setting this property will also set IsContentTypeSet to
|
||||
/// true.
|
||||
/// </remarks>
|
||||
string ContentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Boolean property indicating whether the content type
|
||||
/// property actively has been set.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IsContentTypeSet will go away together with .NET base.
|
||||
/// </remarks>
|
||||
// public bool IsContentTypeSet
|
||||
// {
|
||||
// get { return _contentTypeSet; }
|
||||
// }
|
||||
// private bool _contentTypeSet;
|
||||
|
||||
/// <summary>
|
||||
/// Length of the body content; 0 if there is no body.
|
||||
/// </summary>
|
||||
long ContentLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Alias for ContentLength.
|
||||
/// </summary>
|
||||
long ContentLength64 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encoding of the body content.
|
||||
/// </summary>
|
||||
Encoding ContentEncoding { get; set; }
|
||||
|
||||
bool KeepAlive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the keep alive timeout property (default is
|
||||
/// 20). Setting this to 0 also disables KeepAlive. Setting
|
||||
/// this to something else but 0 also enable KeepAlive.
|
||||
/// </summary>
|
||||
int KeepAliveTimeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return the output stream feeding the body.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// On its way out...
|
||||
/// </remarks>
|
||||
Stream OutputStream { get; }
|
||||
|
||||
string ProtocolVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return the output stream feeding the body.
|
||||
/// </summary>
|
||||
Stream Body { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Set a redirct location.
|
||||
/// </summary>
|
||||
string RedirectLocation { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Chunk transfers.
|
||||
/// </summary>
|
||||
bool SendChunked { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// HTTP status code.
|
||||
/// </summary>
|
||||
int StatusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// HTTP status description.
|
||||
/// </summary>
|
||||
string StatusDescription { get; set; }
|
||||
|
||||
bool ReuseContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Add a header field and content to the response.
|
||||
/// </summary>
|
||||
/// <param name="key">string containing the header field
|
||||
/// name</param>
|
||||
/// <param name="value">string containing the header field
|
||||
/// value</param>
|
||||
void AddHeader(string key, string value);
|
||||
|
||||
/// <summary>
|
||||
/// Send the response back to the remote client
|
||||
/// </summary>
|
||||
void Send();
|
||||
}
|
||||
}
|
||||
|
|
@ -45,13 +45,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
public interface IStreamedRequestHandler : IRequestHandler
|
||||
{
|
||||
// Handle request stream, return byte array
|
||||
byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse);
|
||||
byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
|
||||
}
|
||||
|
||||
public interface IStreamHandler : IRequestHandler
|
||||
{
|
||||
// Handle request stream, return byte array
|
||||
void Handle(string path, Stream request, Stream response, OSHttpRequest httpReqbuest, OSHttpResponse httpResponse);
|
||||
void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse);
|
||||
}
|
||||
|
||||
public interface IGenericHTTPHandler : IRequestHandler
|
||||
|
|
|
@ -39,7 +39,7 @@ using log4net;
|
|||
|
||||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public class OSHttpRequest
|
||||
public class OSHttpRequest : IOSHttpRequest
|
||||
{
|
||||
private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
@ -174,7 +174,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
private Dictionary<string, object> _whiteboard = new Dictionary<string, object>();
|
||||
|
||||
|
||||
public OSHttpRequest() {}
|
||||
|
||||
public OSHttpRequest(IHttpClientContext context, IHttpRequest req)
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
/// OSHttpResponse is the OpenSim representation of an HTTP
|
||||
/// response.
|
||||
/// </summary>
|
||||
public class OSHttpResponse
|
||||
public class OSHttpResponse : IOSHttpResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Content type property.
|
||||
|
@ -275,7 +275,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
protected IHttpResponse _httpResponse;
|
||||
private IHttpClientContext _httpClientContext;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
|
||||
public void Handle(string path, Stream request, Stream responseStream,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
TRequest deserial;
|
||||
using (XmlTextReader xmlReader = new XmlTextReader(request))
|
||||
|
|
|
@ -28,5 +28,5 @@
|
|||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public delegate string RestMethod(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse);
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
|
||||
public void Handle(string path, Stream request, Stream responseStream,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
RestSessionObject<TRequest> deserial = default(RestSessionObject<TRequest>);
|
||||
bool fail = false;
|
||||
|
@ -270,7 +270,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
|
||||
public void Handle(string path, Stream request, Stream responseStream,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
TRequest deserial = default(TRequest);
|
||||
bool fail = false;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
get { return m_restMethod; }
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
StreamReader streamReader = new StreamReader(request, encoding);
|
||||
|
|
|
@ -718,7 +718,7 @@ namespace OpenSim
|
|||
public class SimStatusHandler : IStreamedRequestHandler
|
||||
{
|
||||
public byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return Util.UTF8.GetBytes("OK");
|
||||
}
|
||||
|
@ -755,7 +755,7 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
public byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
|
||||
}
|
||||
|
@ -796,7 +796,7 @@ namespace OpenSim
|
|||
}
|
||||
|
||||
public byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
/// <param name="httpResponse">HTTP response header object</param>
|
||||
/// <returns></returns>
|
||||
public string SeedCapRequest(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||
|
||||
|
@ -256,7 +256,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
/// <param name="httpResponse">HTTP response header object</param>
|
||||
/// <returns></returns>
|
||||
public string ScriptTaskInventory(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -685,7 +685,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public string NoteCardAgentInventory(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request);
|
||||
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request);
|
||||
|
|
|
@ -54,8 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
m_FriendsModule = fmodule;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(
|
||||
string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -1421,7 +1421,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
caps.RegisterHandler("RemoteParcelRequest",
|
||||
new RestStreamHandler("POST", capsBase + remoteParcelRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return RemoteParcelRequest(request, path, param, agentID, caps);
|
||||
}));
|
||||
|
@ -1429,7 +1429,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
caps.RegisterHandler("ParcelPropertiesUpdate",
|
||||
new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ProcessPropertiesUpdate(request, path, param, agentID, caps);
|
||||
}));
|
||||
|
|
|
@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
|||
/// <param name="httpResponse"></param>
|
||||
/// <returns></returns>
|
||||
protected string HandleObjectMediaMessage(
|
||||
string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request);
|
||||
|
||||
|
@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
|||
/// <param name="httpResponse">/param>
|
||||
/// <returns></returns>
|
||||
protected string HandleObjectMediaNavigateMessage(
|
||||
string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request);
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
caps.RegisterHandler("MapLayer",
|
||||
new RestStreamHandler("POST", capsBase + m_mapLayerPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return MapLayerRequest(request, path, param,
|
||||
agentID, caps);
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace OpenSim.Region.DataSnapshot
|
|||
}
|
||||
|
||||
public string OnDiscoveryAttempt(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
//Very static for now, flexible enough to add new formats
|
||||
LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse();
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
osXStatsURI = Util.SHA1Hash(regionInfo.osSecret);
|
||||
}
|
||||
|
||||
public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return Util.UTF8.GetBytes(Report());
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
|||
caps.RegisterHandler("ProvisionVoiceAccountRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ProvisionVoiceAccountRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
@ -317,7 +317,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
|||
caps.RegisterHandler("ParcelVoiceInfoRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ParcelVoiceInfoRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
|||
caps.RegisterHandler("ChatSessionRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ChatSessionRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
|
|
@ -421,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
|
|||
caps.RegisterHandler("ProvisionVoiceAccountRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ProvisionVoiceAccountRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
@ -429,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
|
|||
caps.RegisterHandler("ParcelVoiceInfoRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ParcelVoiceInfoRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
|
|||
caps.RegisterHandler("ChatSessionRequest",
|
||||
new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ChatSessionRequest(scene, request, path, param,
|
||||
agentID, caps);
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
httpResponse.ContentType = "image/jpeg";
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ namespace OpenSim.Region.UserStatistics
|
|||
caps.RegisterHandler("ViewerStats",
|
||||
new RestStreamHandler("POST", capsPath,
|
||||
delegate(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return ViewerStatsReport(request, path, param,
|
||||
agentID, caps);
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] result = new byte[0];
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
|
||||
AssetBase asset = (AssetBase) xs.Deserialize(request);
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace OpenSim.Server.Handlers.Authentication
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
string[] p = SplitParams(path);
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
|
|||
/// Handles all GET and POST requests for OpenID identifier pages and endpoint
|
||||
/// server communication
|
||||
/// </summary>
|
||||
public void Handle(string path, Stream request, Stream response, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public void Handle(string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath));
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Authorization
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest));
|
||||
AuthorizationRequest Authorization = (AuthorizationRequest) xs.Deserialize(request);
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Avatar
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Base
|
|||
}
|
||||
}
|
||||
|
||||
public static bool GetAuthentication(OSHttpRequest httpRequest, out string authority, out string authKey)
|
||||
public static bool GetAuthentication(IOSHttpRequest httpRequest, out string authority, out string authKey)
|
||||
{
|
||||
authority = string.Empty;
|
||||
authKey = string.Empty;
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Friends
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
}
|
||||
|
||||
public string RestGetGridInfoMethod(string request, string path, string param,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.GridUser
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -63,12 +63,12 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return OKResponse(httpResponse);
|
||||
}
|
||||
|
||||
private byte[] OKResponse(OSHttpResponse httpResponse)
|
||||
private byte[] OKResponse(IOSHttpResponse httpResponse)
|
||||
{
|
||||
m_log.Debug("[HELO]: hi, GET was called");
|
||||
httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
|
||||
|
@ -92,12 +92,12 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
return OKResponse(httpResponse);
|
||||
}
|
||||
|
||||
private byte[] OKResponse(OSHttpResponse httpResponse)
|
||||
private byte[] OKResponse(IOSHttpResponse httpResponse)
|
||||
{
|
||||
m_log.Debug("[HELO]: hi, HEAD was called");
|
||||
httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Inventory
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>));
|
||||
List<InventoryItemBase> items = (List<InventoryItemBase>)xs.Deserialize(request);
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace OpenSim.Server.Handlers.MapImage
|
|||
m_MapService = service;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.MapImage
|
|||
m_MapService = service;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] result = new byte[0];
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace OpenSim.Server.Handlers.Neighbour
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// Not implemented yet
|
||||
Console.WriteLine("--- Get region --- " + path);
|
||||
|
@ -84,7 +84,7 @@ namespace OpenSim.Server.Handlers.Neighbour
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] result = new byte[0];
|
||||
|
||||
|
@ -177,7 +177,7 @@ namespace OpenSim.Server.Handlers.Neighbour
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// Not implemented yet
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented;
|
||||
|
@ -198,7 +198,7 @@ namespace OpenSim.Server.Handlers.Neighbour
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// Not implemented yet
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented;
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Presence
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -249,7 +249,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[SIMULATION]: Stream handler called");
|
||||
|
||||
|
@ -436,7 +436,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[SIMULATION]: Stream handler called");
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
|||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream requestData,
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
|
|
|
@ -27,25 +27,107 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
|
||||
namespace OpenSim.Tests.Common.Mock
|
||||
{
|
||||
public class TestOSHttpResponse : OSHttpResponse
|
||||
public class TestOSHttpResponse : IOSHttpResponse
|
||||
{
|
||||
private int m_statusCode;
|
||||
public override int StatusCode
|
||||
{
|
||||
get { return m_statusCode; }
|
||||
set { m_statusCode = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Content type property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Setting this property will also set IsContentTypeSet to
|
||||
/// true.
|
||||
/// </remarks>
|
||||
public string ContentType { get; set; }
|
||||
|
||||
private string m_contentType;
|
||||
public override string ContentType
|
||||
{
|
||||
get { return m_contentType; }
|
||||
set { m_contentType = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Boolean property indicating whether the content type
|
||||
/// property actively has been set.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IsContentTypeSet will go away together with .NET base.
|
||||
/// </remarks>
|
||||
// public bool IsContentTypeSet
|
||||
// {
|
||||
// get { return _contentTypeSet; }
|
||||
// }
|
||||
// private bool _contentTypeSet;
|
||||
|
||||
/// <summary>
|
||||
/// Length of the body content; 0 if there is no body.
|
||||
/// </summary>
|
||||
public long ContentLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Alias for ContentLength.
|
||||
/// </summary>
|
||||
public long ContentLength64 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encoding of the body content.
|
||||
/// </summary>
|
||||
public Encoding ContentEncoding { get; set; }
|
||||
|
||||
public bool KeepAlive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the keep alive timeout property (default is
|
||||
/// 20). Setting this to 0 also disables KeepAlive. Setting
|
||||
/// this to something else but 0 also enable KeepAlive.
|
||||
/// </summary>
|
||||
public int KeepAliveTimeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return the output stream feeding the body.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// On its way out...
|
||||
/// </remarks>
|
||||
public Stream OutputStream { get; private set; }
|
||||
|
||||
public string ProtocolVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return the output stream feeding the body.
|
||||
/// </summary>
|
||||
public Stream Body { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set a redirct location.
|
||||
/// </summary>
|
||||
public string RedirectLocation { private get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Chunk transfers.
|
||||
/// </summary>
|
||||
public bool SendChunked { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// HTTP status code.
|
||||
/// </summary>
|
||||
public int StatusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// HTTP status description.
|
||||
/// </summary>
|
||||
public string StatusDescription { get; set; }
|
||||
|
||||
public bool ReuseContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Add a header field and content to the response.
|
||||
/// </summary>
|
||||
/// <param name="key">string containing the header field
|
||||
/// name</param>
|
||||
/// <param name="value">string containing the header field
|
||||
/// value</param>
|
||||
public void AddHeader(string key, string value) { throw new NotImplementedException(); }
|
||||
|
||||
public void Send() { }
|
||||
}
|
||||
}
|
|
@ -2677,9 +2677,11 @@
|
|||
<ReferencePath>../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Core"/>
|
||||
<Reference name="System.Data"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="System.Data"/>
|
||||
<Reference name="System.Web"/>
|
||||
<Reference name="HttpServer_OpenSim" path="../../../bin/"/>
|
||||
<Reference name="log4net" path="../../../bin/"/>
|
||||
<Reference name="Mono.Addins" path="../../../bin/"/>
|
||||
<Reference name="Nini" path="../../../bin/"/>
|
||||
|
@ -2726,6 +2728,7 @@
|
|||
</Files>
|
||||
</Project>
|
||||
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Data.Tests" path="OpenSim/Data/Tests" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
|
|
Loading…
Reference in New Issue