Convert worldview to GET

avinationmerge
Melanie 2010-10-06 05:15:47 +02:00
parent b7586806cd
commit 1a47ec082e
1 changed files with 11 additions and 7 deletions

View File

@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
protected Object m_RequestLock = new Object(); protected Object m_RequestLock = new Object();
public WorldViewRequestHandler(WorldViewModule fmodule, string rid) public WorldViewRequestHandler(WorldViewModule fmodule, string rid)
: base("POST", "/worldview/" + rid) : base("GET", "/worldview/" + rid)
{ {
m_WorldViewModule = fmodule; m_WorldViewModule = fmodule;
} }
@ -58,24 +58,28 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
public override byte[] Handle(string path, Stream requestData, public override byte[] Handle(string path, Stream requestData,
OSHttpRequest httpRequest, OSHttpResponse httpResponse) OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{ {
StreamReader sr = new StreamReader(requestData); httpResponse.ContentType = "image/jpeg";
string body = sr.ReadToEnd();
sr.Close(); // StreamReader sr = new StreamReader(requestData);
body = body.Trim(); // string body = sr.ReadToEnd();
// sr.Close();
// body = body.Trim();
try try
{ {
lock (m_RequestLock) lock (m_RequestLock)
{ {
Dictionary<string, object> request = Dictionary<string, object> request =
ServerUtils.ParseQueryString(body); new Dictionary<string, object>();
foreach (string name in httpRequest.QueryString)
request[name] = httpRequest.QueryString[name];
return SendWorldView(request); return SendWorldView(request);
} }
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Debug("[WORLDVIEW]: Exception {0}" + e.ToString()); m_log.Debug("[WORLDVIEW]: Exception: " + e.ToString());
} }
return new Byte[0]; return new Byte[0];