Sync code that has moved in development branch with changes in master
parent
fce3fca7f9
commit
9aec36156e
|
@ -95,9 +95,12 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
webRequest.ContentType = "application/json-rpc";
|
webRequest.ContentType = "application/json-rpc";
|
||||||
webRequest.Method = "POST";
|
webRequest.Method = "POST";
|
||||||
|
|
||||||
Stream dataStream = webRequest.GetRequestStream();
|
//Stream dataStream = webRequest.GetRequestStream();
|
||||||
|
//dataStream.Write(content, 0, content.Length);
|
||||||
|
//dataStream.Close();
|
||||||
|
|
||||||
|
using (Stream dataStream = webRequest.GetRequestStream())
|
||||||
dataStream.Write(content, 0, content.Length);
|
dataStream.Write(content, 0, content.Length);
|
||||||
dataStream.Close();
|
|
||||||
|
|
||||||
WebResponse webResponse = null;
|
WebResponse webResponse = null;
|
||||||
try
|
try
|
||||||
|
@ -111,19 +114,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream rstream = webResponse.GetResponseStream();
|
using (webResponse)
|
||||||
|
using (Stream rstream = webResponse.GetResponseStream())
|
||||||
OSDMap mret = new OSDMap();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
mret = (OSDMap)OSDParser.DeserializeJson(rstream);
|
OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream);
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[JSONRPC]: JsonRpcRequest Error {0}", e.Message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mret.ContainsKey("error"))
|
if (mret.ContainsKey("error"))
|
||||||
return false;
|
return false;
|
||||||
|
@ -132,6 +126,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
OSD.DeserializeMembers(ref parameters, (OSDMap)mret["result"]);
|
OSD.DeserializeMembers(ref parameters, (OSDMap)mret["result"]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends json-rpc request with OSD parameter.
|
/// Sends json-rpc request with OSD parameter.
|
||||||
|
@ -171,9 +166,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
webRequest.ContentType = "application/json-rpc";
|
webRequest.ContentType = "application/json-rpc";
|
||||||
webRequest.Method = "POST";
|
webRequest.Method = "POST";
|
||||||
|
|
||||||
Stream dataStream = webRequest.GetRequestStream();
|
using (Stream dataStream = webRequest.GetRequestStream())
|
||||||
dataStream.Write(content, 0, content.Length);
|
dataStream.Write(content, 0, content.Length);
|
||||||
dataStream.Close();
|
|
||||||
|
|
||||||
WebResponse webResponse = null;
|
WebResponse webResponse = null;
|
||||||
try
|
try
|
||||||
|
@ -187,8 +181,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream rstream = webResponse.GetResponseStream();
|
using (webResponse)
|
||||||
|
using (Stream rstream = webResponse.GetResponseStream())
|
||||||
|
{
|
||||||
OSDMap response = new OSDMap();
|
OSDMap response = new OSDMap();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -210,6 +205,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endregion Web Util
|
#endregion Web Util
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue