aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs
diff options
context:
space:
mode:
authorMelanie2011-10-26 17:55:53 +0200
committerMelanie2011-10-26 17:55:53 +0200
commitc763419043773c93dbbc865ec35f7ecf856a641a (patch)
treeac9f99c33ae788e6b7fdfd0843c2ae584a896dc6 /OpenSim/Framework/WebUtil.cs
parentFix a missing locking call (diff)
parentMerge branch 'master' into bigmerge (diff)
downloadopensim-SC_OLD-c763419043773c93dbbc865ec35f7ecf856a641a.zip
opensim-SC_OLD-c763419043773c93dbbc865ec35f7ecf856a641a.tar.gz
opensim-SC_OLD-c763419043773c93dbbc865ec35f7ecf856a641a.tar.bz2
opensim-SC_OLD-c763419043773c93dbbc865ec35f7ecf856a641a.tar.xz
Merge branch 'bigmerge' of ssh://3dhosting.de/var/git/careminster into bigmerge
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r--OpenSim/Framework/WebUtil.cs60
1 files changed, 29 insertions, 31 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 971c0b7..60c1e15 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -39,9 +39,7 @@ using System.Text;
39using System.Web; 39using System.Web;
40using System.Xml; 40using System.Xml;
41using System.Xml.Serialization; 41using System.Xml.Serialization;
42
43using log4net; 42using log4net;
44using OpenSim.Framework.Servers.HttpServer;
45using OpenMetaverse.StructuredData; 43using OpenMetaverse.StructuredData;
46 44
47namespace OpenSim.Framework 45namespace 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