diff options
author | Justin Clark-Casey (justincc) | 2011-10-25 20:24:21 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-25 20:24:21 +0100 |
commit | 8a0a78cbccce796addacab7ed1609279b802a9b3 (patch) | |
tree | 31ddb6da7bca6eeb61cb7747532dcf77828cfbe3 /OpenSim/Framework/WebUtil.cs | |
parent | Drop some unnecessary ContainsKey() checking before Remove() in BaseHttpServer() (diff) | |
download | opensim-SC-8a0a78cbccce796addacab7ed1609279b802a9b3.zip opensim-SC-8a0a78cbccce796addacab7ed1609279b802a9b3.tar.gz opensim-SC-8a0a78cbccce796addacab7ed1609279b802a9b3.tar.bz2 opensim-SC-8a0a78cbccce796addacab7ed1609279b802a9b3.tar.xz |
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)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index be7504f..cafa441 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -39,9 +39,7 @@ using System.Text; | |||
39 | using System.Web; | 39 | using System.Web; |
40 | using System.Xml; | 40 | using System.Xml; |
41 | using System.Xml.Serialization; | 41 | using System.Xml.Serialization; |
42 | |||
43 | using log4net; | 42 | using log4net; |
44 | using OpenSim.Framework.Servers.HttpServer; | ||
45 | using OpenMetaverse.StructuredData; | 43 | using OpenMetaverse.StructuredData; |
46 | 44 | ||
47 | namespace OpenSim.Framework | 45 | namespace OpenSim.Framework |
@@ -65,35 +63,35 @@ namespace OpenSim.Framework | |||
65 | // a "long" call for warning & debugging purposes | 63 | // a "long" call for warning & debugging purposes |
66 | public const int LongCallTime = 500; | 64 | public const int LongCallTime = 500; |
67 | 65 | ||
68 | /// <summary> | 66 | // /// <summary> |
69 | /// Send LLSD to an HTTP client in application/llsd+json form | 67 | // /// Send LLSD to an HTTP client in application/llsd+json form |
70 | /// </summary> | 68 | // /// </summary> |
71 | /// <param name="response">HTTP response to send the data in</param> | 69 | // /// <param name="response">HTTP response to send the data in</param> |
72 | /// <param name="body">LLSD to send to the client</param> | 70 | // /// <param name="body">LLSD to send to the client</param> |
73 | public static void SendJSONResponse(OSHttpResponse response, OSDMap body) | 71 | // public static void SendJSONResponse(OSHttpResponse response, OSDMap body) |
74 | { | 72 | // { |
75 | byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body)); | 73 | // byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body)); |
76 | 74 | // | |
77 | response.ContentEncoding = Encoding.UTF8; | 75 | // response.ContentEncoding = Encoding.UTF8; |
78 | response.ContentLength = responseData.Length; | 76 | // response.ContentLength = responseData.Length; |
79 | response.ContentType = "application/llsd+json"; | 77 | // response.ContentType = "application/llsd+json"; |
80 | response.Body.Write(responseData, 0, responseData.Length); | 78 | // response.Body.Write(responseData, 0, responseData.Length); |
81 | } | 79 | // } |
82 | 80 | // | |
83 | /// <summary> | 81 | // /// <summary> |
84 | /// Send LLSD to an HTTP client in application/llsd+xml form | 82 | // /// Send LLSD to an HTTP client in application/llsd+xml form |
85 | /// </summary> | 83 | // /// </summary> |
86 | /// <param name="response">HTTP response to send the data in</param> | 84 | // /// <param name="response">HTTP response to send the data in</param> |
87 | /// <param name="body">LLSD to send to the client</param> | 85 | // /// <param name="body">LLSD to send to the client</param> |
88 | public static void SendXMLResponse(OSHttpResponse response, OSDMap body) | 86 | // public static void SendXMLResponse(OSHttpResponse response, OSDMap body) |
89 | { | 87 | // { |
90 | byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body); | 88 | // byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body); |
91 | 89 | // | |
92 | response.ContentEncoding = Encoding.UTF8; | 90 | // response.ContentEncoding = Encoding.UTF8; |
93 | response.ContentLength = responseData.Length; | 91 | // response.ContentLength = responseData.Length; |
94 | response.ContentType = "application/llsd+xml"; | 92 | // response.ContentType = "application/llsd+xml"; |
95 | response.Body.Write(responseData, 0, responseData.Length); | 93 | // response.Body.Write(responseData, 0, responseData.Length); |
96 | } | 94 | // } |
97 | 95 | ||
98 | /// <summary> | 96 | /// <summary> |
99 | /// Make a GET or GET-like request to a web service that returns LLSD | 97 | /// Make a GET or GET-like request to a web service that returns LLSD |