From bf9132e1c7a1ddaf291101f60f43c0cbd0f53662 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Tue, 26 Feb 2013 11:32:01 -0800
Subject: BulletSim: fix crash around race condition when a mesh asset cannot
be fetched. Update TODO list.
---
OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 2 +-
OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | 18 +++++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 4dff927..8f660c4 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -470,7 +470,7 @@ public class BSPrim : BSPhysObject
// Note that this does not change _mass!
public override void UpdatePhysicalMassProperties(float physMass, bool inWorld)
{
- if (PhysBody.HasPhysicalBody)
+ if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape)
{
if (IsStatic)
{
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
index 49718c4..4dc16f4 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
@@ -1,5 +1,12 @@
CURRENT PRIORITIES
=================================================
+Use the HACD convex hull routine in Bullet rather than the C# version.
+ Speed up hullifying large meshes.
+Enable vehicle border crossings (at least as poorly as ODE)
+ Terrain skirts
+ Avatar created in previous region and not new region when crossing border
+ Vehicle recreated in new sim at small Z value (offset from root value?) (DONE)
+Lock axis
Deleting a linkset while standing on the root will leave the physical shape of the root behind.
Not sure if it is because standing on it. Done with large prim linksets.
Vehicle angular vertical attraction
@@ -7,16 +14,11 @@ vehicle angular banking
Center-of-gravity
Vehicle angular deflection
Preferred orientation angular correction fix
-Enable vehicle border crossings (at least as poorly as ODE)
- Terrain skirts
- Avatar created in previous region and not new region when crossing border
- Vehicle recreated in new sim at small Z value (offset from root value?) (DONE)
when should angular and linear motor targets be zeroed? when selected?
Need a vehicle.clear()? Or an 'else' in prestep if not physical.
Teravus llMoveToTarget script debug
Mixing of hover, buoyancy/gravity, moveToTarget, into one force
Setting hover height to zero disables hover even if hover flags are on (from SL wiki)
-Nebadon vehicles turning funny in arena
limitMotorUp calibration (more down?)
llRotLookAt
llLookAt
@@ -66,6 +68,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation
GENERAL TODO LIST:
=================================================
+Resitution of a prim works on another prim but not on terrain.
+ The dropped prim doesn't bounce properly on the terrain.
Add a sanity check for PIDTarget location.
Level-of-detail for mesh creation. Prims with circular interiors require lod of 32.
Is much saved with lower LODs? At the moment, all set to 32.
@@ -163,7 +167,6 @@ Create tests for different interface components
Have test objects/scripts measure themselves and turn color if correct/bad
Test functions in SL and calibrate correctness there
Create auto rezzer and tracker to run through the tests
-Use the HACD convex hull routine in Bullet rather than the C# version.
Do we need to do convex hulls all the time? Can complex meshes be left meshes?
There is some problem with meshes and collisions
Hulls are not as detailed as meshes. Hulled vehicles insides are different shape.
@@ -334,4 +337,5 @@ Child movement in linkset (don't rebuild linkset) (DONE 20130122))
Avatar standing on a moving object should start to move with the object. (DONE 20130125)
Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE.
Verify that angular motion specified around Z moves in the vehicle coordinates.
- DONE 20130120: BulletSim properly applies force in vehicle relative coordinates.
\ No newline at end of file
+ DONE 20130120: BulletSim properly applies force in vehicle relative coordinates.
+Nebadon vehicles turning funny in arena (DONE)
\ No newline at end of file
--
cgit v1.1
From b8a7c8b26f3005eed5b161c37509b06b1d604967 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 26 Feb 2013 23:36:36 +0000
Subject: Add regression test for llRequestUrl()
---
.../CoreModules/Scripting/LSLHttp/UrlModule.cs | 37 ++++++++++++----------
.../Region/Framework/Interfaces/IScriptModule.cs | 11 +++++++
.../Shared/Api/Implementation/LSL_Api.cs | 1 +
3 files changed, 33 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index be617a5..79e633f 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -122,15 +122,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
///
private int m_TotalUrls = 100;
- private uint https_port = 0;
+ private uint m_HttpsPort = 0;
private IHttpServer m_HttpServer = null;
private IHttpServer m_HttpsServer = null;
- private string m_ExternalHostNameForLSL = "";
- public string ExternalHostNameForLSL
- {
- get { return m_ExternalHostNameForLSL; }
- }
+ public string ExternalHostNameForLSL { get; private set; }
public Type ReplaceableInterface
{
@@ -144,11 +140,20 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void Initialise(IConfigSource config)
{
- m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName);
- bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false);
+ IConfig networkConfig = config.Configs["Network"];
+
+ if (networkConfig != null)
+ {
+ ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", null);
+
+ bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener", false);
+
+ if (ssl_enabled)
+ m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
+ }
- if (ssl_enabled)
- https_port = (uint) config.Configs["Network"].GetInt("https_port",0);
+ if (ExternalHostNameForLSL == null)
+ ExternalHostNameForLSL = System.Environment.MachineName;
IConfig llFunctionsConfig = config.Configs["LL-Functions"];
@@ -169,9 +174,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
m_HttpServer = MainServer.Instance;
//
// We can use the https if it is enabled
- if (https_port > 0)
+ if (m_HttpsPort > 0)
{
- m_HttpsServer = MainServer.GetHttpServer(https_port);
+ m_HttpsServer = MainServer.GetHttpServer(m_HttpsPort);
}
}
@@ -209,7 +214,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
return urlcode;
}
- string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
+ string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
UrlData urlData = new UrlData();
urlData.hostID = host.UUID;
@@ -254,7 +259,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
return urlcode;
}
- string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
+ string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
UrlData urlData = new UrlData();
urlData.hostID = host.UUID;
@@ -579,9 +584,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
string url;
if (is_ssl)
- url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
+ url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
else
- url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
+ url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
// Avoid a race - the request URL may have been released via llRequestUrl() whilst this
// request was being processed.
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 143af48..ced4e91 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -52,7 +52,18 @@ namespace OpenSim.Region.Framework.Interfaces
string GetXMLState(UUID itemID);
bool SetXMLState(UUID itemID, string xml);
+ ///
+ /// Post a script event to a single script.
+ ///
+ /// true if the post suceeded, false if it did not
+ /// The item ID of the script.
+ /// The name of the event.
+ ///
+ /// The arguments of the event. These are in the order in which they appear.
+ /// e.g. for http_request this will be an object array of key request_id, string method, string body
+ ///
bool PostScriptEvent(UUID itemID, string name, Object[] args);
+
bool PostObjectEvent(UUID itemID, string name, Object[] args);
///
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 96f650e..6a31568 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -9423,6 +9423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return UUID.Zero.ToString();
}
}
+
public LSL_String llRequestURL()
{
m_host.AddScriptLPS(1);
--
cgit v1.1
From 80c19b7cac52a57fd04966169c657400aeee3de8 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 27 Feb 2013 00:21:02 +0000
Subject: Make sure we dispose of WebResponse, StreamReader and Stream in
various places where we were not already.
---
.../Scripting/VectorRender/VectorRenderModule.cs | 16 +++++---
.../CoreModules/World/WorldMap/WorldMapModule.cs | 30 +++++++-------
.../Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 21 ++++++----
.../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 12 +++---
.../XmlRpcGroupsServicesConnectorModule.cs | 46 +++++++++++++---------
5 files changed, 71 insertions(+), 54 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index 689e8a7..f04fabe 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -838,13 +838,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
try
{
WebRequest request = HttpWebRequest.Create(url);
-//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used.
-//Ckrinke Stream str = null;
- HttpWebResponse response = (HttpWebResponse)(request).GetResponse();
- if (response.StatusCode == HttpStatusCode.OK)
+
+ using (HttpWebResponse response = (HttpWebResponse)(request).GetResponse())
{
- Bitmap image = new Bitmap(response.GetResponseStream());
- return image;
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ using (Stream s = response.GetResponseStream())
+ {
+ Bitmap image = new Bitmap(s);
+ return image;
+ }
+ }
}
}
catch { }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 912d50a..c50ab64 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -868,20 +868,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
string response_mapItems_reply = null;
- { // get the response
- StreamReader sr = null;
+ {
try
{
- WebResponse webResponse = mapitemsrequest.GetResponse();
- if (webResponse != null)
- {
- sr = new StreamReader(webResponse.GetResponseStream());
- response_mapItems_reply = sr.ReadToEnd().Trim();
- }
- else
+ using (WebResponse webResponse = mapitemsrequest.GetResponse())
{
- return new OSDMap();
- }
+ if (webResponse != null)
+ {
+ using (Stream s = webResponse.GetResponseStream())
+ using (StreamReader sr = new StreamReader(s))
+ response_mapItems_reply = sr.ReadToEnd().Trim();
+ }
+ else
+ {
+ return new OSDMap();
+ }
+ }
}
catch (WebException)
{
@@ -908,11 +910,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return responseMap;
}
- finally
- {
- if (sr != null)
- sr.Close();
- }
OSD rezResponse = null;
try
@@ -926,6 +923,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
m_log.InfoFormat("[WORLD MAP]: exception on parse of RequestMapItems reply from {0}: {1}", httpserver, ex.Message);
responseMap["connect"] = OSD.FromBoolean(false);
+
lock (m_blacklistedregions)
{
if (!m_blacklistedregions.ContainsKey(regionhandle))
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 37ab35a..ef1b92e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -551,13 +551,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
reqStream.Close();
}
- HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse();
- Encoding encoding = Util.UTF8;
- StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding);
- fwdresponsestr = fwdresponsestream.ReadToEnd();
- fwdresponsecontenttype = fwdrsp.ContentType;
- fwdresponsecode = (int)fwdrsp.StatusCode;
- fwdresponsestream.Close();
+ using (HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse())
+ {
+ Encoding encoding = Util.UTF8;
+
+ using (Stream s = fwdrsp.GetResponseStream())
+ {
+ using (StreamReader fwdresponsestream = new StreamReader(s))
+ {
+ fwdresponsestr = fwdresponsestream.ReadToEnd();
+ fwdresponsecontenttype = fwdrsp.ContentType;
+ fwdresponsecode = (int)fwdrsp.StatusCode;
+ }
+ }
+ }
response["content_type"] = fwdresponsecontenttype;
response["str_response_string"] = fwdresponsestr;
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 881807a..cb69411 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -1116,18 +1116,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
// Otherwise prepare the request
m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl);
- HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
- HttpWebResponse rsp = null;
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
// We are sending just parameters, no content
req.ContentLength = 0;
// Send request and retrieve the response
- rsp = (HttpWebResponse)req.GetResponse();
-
- XmlTextReader rdr = new XmlTextReader(rsp.GetResponseStream());
- doc.Load(rdr);
- rdr.Close();
+ using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse())
+ using (Stream s = rsp.GetResponseStream())
+ using (XmlTextReader rdr = new XmlTextReader(s))
+ doc.Load(rdr);
}
catch (Exception e)
{
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index 1101851..71b24ac 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -1146,28 +1146,38 @@ namespace Nwc.XmlRpc
request.AllowWriteStreamBuffering = true;
request.KeepAlive = !_disableKeepAlive;
- Stream stream = request.GetRequestStream();
- XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII);
- _serializer.Serialize(xml, this);
- xml.Flush();
- xml.Close();
-
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
- StreamReader input = new StreamReader(response.GetResponseStream());
-
- string inputXml = input.ReadToEnd();
- XmlRpcResponse resp;
- try
+ using (Stream stream = request.GetRequestStream())
{
- resp = (XmlRpcResponse)_deserializer.Deserialize(inputXml);
+ using (XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII))
+ {
+ _serializer.Serialize(xml, this);
+ xml.Flush();
+ }
}
- catch (Exception e)
+
+ XmlRpcResponse resp;
+
+ using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
- RequestResponse = inputXml;
- throw e;
+ using (Stream s = response.GetResponseStream())
+ {
+ using (StreamReader input = new StreamReader(s))
+ {
+ string inputXml = input.ReadToEnd();
+
+ try
+ {
+ resp = (XmlRpcResponse)_deserializer.Deserialize(inputXml);
+ }
+ catch (Exception e)
+ {
+ RequestResponse = inputXml;
+ throw e;
+ }
+ }
+ }
}
- input.Close();
- response.Close();
+
return resp;
}
}
--
cgit v1.1