mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
Make OpenSim.Framework.Servers.HttpServer rely on OpenSim.Framework instead of the other way around.
This is necessary so that code in HttpServer can use framework facilities such as the thread watchdog for monitoring purposes. Doing this shuffle meant that MainServer was moved into OpenSim/Framework/Servers Also had to make OpenSim.Framework.Console rely on OpenSim.Framework rather than the other way around since it in turn relies on HttpServer MainConsole and some new interfaces had to be moved into OpenSim/Framework to allow this. This can be reverted if parts of OpenSim.Framework stop relying on console presence (cheifly RegionInfo)
This commit is contained in:
@@ -39,9 +39,7 @@ using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using log4net;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -65,35 +63,35 @@ namespace OpenSim.Framework
|
||||
// a "long" call for warning & debugging purposes
|
||||
public const int LongCallTime = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Send LLSD to an HTTP client in application/llsd+json form
|
||||
/// </summary>
|
||||
/// <param name="response">HTTP response to send the data in</param>
|
||||
/// <param name="body">LLSD to send to the client</param>
|
||||
public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
|
||||
{
|
||||
byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
|
||||
|
||||
response.ContentEncoding = Encoding.UTF8;
|
||||
response.ContentLength = responseData.Length;
|
||||
response.ContentType = "application/llsd+json";
|
||||
response.Body.Write(responseData, 0, responseData.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send LLSD to an HTTP client in application/llsd+xml form
|
||||
/// </summary>
|
||||
/// <param name="response">HTTP response to send the data in</param>
|
||||
/// <param name="body">LLSD to send to the client</param>
|
||||
public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
|
||||
{
|
||||
byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
|
||||
|
||||
response.ContentEncoding = Encoding.UTF8;
|
||||
response.ContentLength = responseData.Length;
|
||||
response.ContentType = "application/llsd+xml";
|
||||
response.Body.Write(responseData, 0, responseData.Length);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+json form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+json";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+xml form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+xml";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Make a GET or GET-like request to a web service that returns LLSD
|
||||
|
||||
Reference in New Issue
Block a user