aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Capabilities/LLSDStreamHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Capabilities/LLSDStreamHandler.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/Capabilities/LLSDStreamHandler.cs b/OpenSim/Region/Capabilities/LLSDStreamHandler.cs
index ff63353..7d99b6e 100644
--- a/OpenSim/Region/Capabilities/LLSDStreamHandler.cs
+++ b/OpenSim/Region/Capabilities/LLSDStreamHandler.cs
@@ -14,25 +14,27 @@ namespace OpenSim.Region.Capabilities
14 private LLSDMethod<TRequest, TResponse> m_method; 14 private LLSDMethod<TRequest, TResponse> m_method;
15 15
16 public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) 16 public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method)
17 : base(httpMethod, path) 17 : base(httpMethod, path )
18 { 18 {
19 m_method = method; 19 m_method = method;
20 } 20 }
21 21
22 public override byte[] Handle(string path, Stream request) 22 public override byte[] Handle(string path, Stream request)
23 { 23 {
24 Encoding encoding = Encoding.UTF8; 24 //Encoding encoding = Encoding.UTF8;
25 StreamReader streamReader = new StreamReader(request, encoding); 25 //StreamReader streamReader = new StreamReader(request, false);
26 26
27 string requestBody = streamReader.ReadToEnd(); 27 //string requestBody = streamReader.ReadToEnd();
28 streamReader.Close(); 28 //streamReader.Close();
29 29
30 Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(encoding.GetBytes(requestBody)); 30 Hashtable hash = (Hashtable)LLSD.LLSDDeserialize( request );
31 TRequest llsdRequest = new TRequest(); 31 TRequest llsdRequest = new TRequest();
32 LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); 32 LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
33 33
34 TResponse response = m_method(llsdRequest); 34 TResponse response = m_method(llsdRequest);
35 35
36 Encoding encoding = new UTF8Encoding(false);
37
36 return encoding.GetBytes( LLSDHelpers.SerialiseLLSDReply(response) ); 38 return encoding.GetBytes( LLSDHelpers.SerialiseLLSDReply(response) );
37 39
38 } 40 }