aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-06 12:15:24 -0700
committerJohn Hurliman2009-10-06 12:15:24 -0700
commitfa6027aa09190ce50cfabcd3092836f21c99228c (patch)
treee0ee78f308c1933f6d3aa9c6e80c2fcf4a75d6a2 /OpenSim
parent* Added missing references to prebuild.xml and commented out the LindenUDP te... (diff)
parent* Removed verbose debug message (diff)
downloadopensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.zip
opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.gz
opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.bz2
opensim-SC_OLD-fa6027aa09190ce50cfabcd3092836f21c99228c.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into htb-throttle
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLAuthenticationData.cs62
-rw-r--r--OpenSim/Data/MySQL/MySQLFramework.cs14
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserAccountData.cs74
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs16
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs2
-rw-r--r--OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs7
12 files changed, 103 insertions, 87 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index a41f9f8..0780936 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -55,42 +55,40 @@ namespace OpenSim.Data.MySQL
55 AuthenticationData ret = new AuthenticationData(); 55 AuthenticationData ret = new AuthenticationData();
56 ret.Data = new Dictionary<string, object>(); 56 ret.Data = new Dictionary<string, object>();
57 57
58 using (MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID")) 58 MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID");
59
60 cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
61
62 IDataReader result = ExecuteReader(cmd);
63
64 if (result.Read())
59 { 65 {
60 cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); 66 ret.PrincipalID = principalID;
67
68 if (m_ColumnNames == null)
69 {
70 m_ColumnNames = new List<string>();
61 71
62 using (IDataReader result = ExecuteReader(cmd)) 72 DataTable schemaTable = result.GetSchemaTable();
73 foreach (DataRow row in schemaTable.Rows)
74 m_ColumnNames.Add(row["ColumnName"].ToString());
75 }
76
77 foreach (string s in m_ColumnNames)
63 { 78 {
64 if (result.Read()) 79 if (s == "UUID")
65 { 80 continue;
66 ret.PrincipalID = principalID; 81
67 82 ret.Data[s] = result[s].ToString();
68 if (m_ColumnNames == null)
69 {
70 m_ColumnNames = new List<string>();
71
72 DataTable schemaTable = result.GetSchemaTable();
73 foreach (DataRow row in schemaTable.Rows)
74 m_ColumnNames.Add(row["ColumnName"].ToString());
75 }
76
77 foreach (string s in m_ColumnNames)
78 {
79 if (s == "UUID")
80 continue;
81
82 ret.Data[s] = result[s].ToString();
83 }
84
85 CloseDBConnection(cmd);
86 return ret;
87 }
88 else
89 {
90 CloseDBConnection(cmd);
91 return null;
92 }
93 } 83 }
84
85 CloseDBConnection(result, cmd);
86 return ret;
87 }
88 else
89 {
90 CloseDBConnection(result, cmd);
91 return null;
94 } 92 }
95 } 93 }
96 94
diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs
index f37e9bc..ccd1ab0 100644
--- a/OpenSim/Data/MySQL/MySQLFramework.cs
+++ b/OpenSim/Data/MySQL/MySQLFramework.cs
@@ -40,7 +40,9 @@ namespace OpenSim.Data.MySQL
40 /// </summary> 40 /// </summary>
41 public class MySqlFramework 41 public class MySqlFramework
42 { 42 {
43 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly log4net.ILog m_log =
44 log4net.LogManager.GetLogger(
45 System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44 46
45 protected MySqlConnection m_Connection; 47 protected MySqlConnection m_Connection;
46 48
@@ -81,7 +83,8 @@ namespace OpenSim.Data.MySQL
81 errorSeen = true; 83 errorSeen = true;
82 84
83 m_Connection.Close(); 85 m_Connection.Close();
84 MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone(); 86 MySqlConnection newConnection =
87 (MySqlConnection)((ICloneable)m_Connection).Clone();
85 m_Connection.Dispose(); 88 m_Connection.Dispose();
86 m_Connection = newConnection; 89 m_Connection = newConnection;
87 m_Connection.Open(); 90 m_Connection.Open();
@@ -102,15 +105,18 @@ namespace OpenSim.Data.MySQL
102 105
103 protected IDataReader ExecuteReader(MySqlCommand cmd) 106 protected IDataReader ExecuteReader(MySqlCommand cmd)
104 { 107 {
105 MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone(); 108 MySqlConnection newConnection =
109 (MySqlConnection)((ICloneable)m_Connection).Clone();
106 newConnection.Open(); 110 newConnection.Open();
107 111
108 cmd.Connection = newConnection; 112 cmd.Connection = newConnection;
109 return cmd.ExecuteReader(); 113 return cmd.ExecuteReader();
110 } 114 }
111 115
112 protected void CloseDBConnection(MySqlCommand cmd) 116 protected void CloseDBConnection(IDataReader reader, MySqlCommand cmd)
113 { 117 {
118 reader.Close();
119 cmd.Connection.Close();
114 cmd.Connection.Dispose(); 120 cmd.Connection.Dispose();
115 } 121 }
116 } 122 }
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 3fe27d5..3b561d1 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -173,7 +173,7 @@ namespace OpenSim.Data.MySQL
173 retList.Add(ret); 173 retList.Add(ret);
174 } 174 }
175 175
176 CloseDBConnection(cmd); 176 CloseDBConnection(result, cmd);
177 } 177 }
178 178
179 return retList; 179 return retList;
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index 38a6f55..0bbc3f5 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -64,48 +64,46 @@ namespace OpenSim.Data.MySQL
64 if (scopeID != UUID.Zero) 64 if (scopeID != UUID.Zero)
65 command += " and ScopeID = ?scopeID"; 65 command += " and ScopeID = ?scopeID";
66 66
67 using (MySqlCommand cmd = new MySqlCommand(command)) 67 MySqlCommand cmd = new MySqlCommand(command);
68
69 cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
70 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
71
72 IDataReader result = ExecuteReader(cmd);
73
74 if (result.Read())
68 { 75 {
69 cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); 76 ret.PrincipalID = principalID;
70 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 77 UUID scope;
78 UUID.TryParse(result["ScopeID"].ToString(), out scope);
79 ret.ScopeID = scope;
71 80
72 using (IDataReader result = ExecuteReader(cmd)) 81 if (m_ColumnNames == null)
73 { 82 {
74 if (result.Read()) 83 m_ColumnNames = new List<string>();
75 { 84
76 ret.PrincipalID = principalID; 85 DataTable schemaTable = result.GetSchemaTable();
77 UUID scope; 86 foreach (DataRow row in schemaTable.Rows)
78 UUID.TryParse(result["ScopeID"].ToString(), out scope); 87 m_ColumnNames.Add(row["ColumnName"].ToString());
79 ret.ScopeID = scope;
80
81 if (m_ColumnNames == null)
82 {
83 m_ColumnNames = new List<string>();
84
85 DataTable schemaTable = result.GetSchemaTable();
86 foreach (DataRow row in schemaTable.Rows)
87 m_ColumnNames.Add(row["ColumnName"].ToString());
88 }
89
90 foreach (string s in m_ColumnNames)
91 {
92 if (s == "UUID")
93 continue;
94 if (s == "ScopeID")
95 continue;
96
97 ret.Data[s] = result[s].ToString();
98 }
99
100 CloseDBConnection(cmd);
101 return ret;
102 }
103 else
104 {
105 CloseDBConnection(cmd);
106 return null;
107 }
108 } 88 }
89
90 foreach (string s in m_ColumnNames)
91 {
92 if (s == "UUID")
93 continue;
94 if (s == "ScopeID")
95 continue;
96
97 ret.Data[s] = result[s].ToString();
98 }
99
100 CloseDBConnection(result, cmd);
101 return ret;
102 }
103 else
104 {
105 CloseDBConnection(result, cmd);
106 return null;
109 } 107 }
110 } 108 }
111 109
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs
index 7a73506..d98f47d 100644
--- a/OpenSim/Framework/Communications/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient.cs
@@ -318,11 +318,11 @@ namespace OpenSim.Framework.Communications
318 HttpWebResponse errorResponse = e.Response as HttpWebResponse; 318 HttpWebResponse errorResponse = e.Response as HttpWebResponse;
319 if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode) 319 if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
320 { 320 {
321 m_log.Warn("[ASSET] Asset not found (404)"); 321 m_log.Warn("[REST CLIENT] Resource not found (404)");
322 } 322 }
323 else 323 else
324 { 324 {
325 m_log.Error("[ASSET] Error fetching asset from asset server"); 325 m_log.Error("[REST CLIENT] Error fetching resource from server " + _request.Address.ToString());
326 m_log.Debug(e.ToString()); 326 m_log.Debug(e.ToString());
327 } 327 }
328 328
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
index bb9a4b2..879cc70 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset
98 98
99 m_log.Info("[RegionAssetService]: Starting..."); 99 m_log.Info("[RegionAssetService]: Starting...");
100 100
101 Object[] args = new Object[] { m_Config, MainServer.Instance }; 101 Object[] args = new Object[] { m_Config, MainServer.Instance, string.Empty };
102 102
103 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args); 103 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args);
104 } 104 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
index c326818..54c6d89 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
98 98
99 m_log.Info("[RegionInventoryService]: Starting..."); 99 m_log.Info("[RegionInventoryService]: Starting...");
100 100
101 Object[] args = new Object[] { m_Config, MainServer.Instance }; 101 Object[] args = new Object[] { m_Config, MainServer.Instance, String.Empty };
102 102
103 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:InventoryServiceInConnector", args); 103 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:InventoryServiceInConnector", args);
104 } 104 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
index 44e850b..6c89ac8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
@@ -61,6 +61,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
61 61
62 private void OnRegionUp(GridRegion otherRegion) 62 private void OnRegionUp(GridRegion otherRegion)
63 { 63 {
64 // This shouldn't happen
65 if (otherRegion == null)
66 return;
67
64 m_log.DebugFormat("[REGION CACHE]: (on region {0}) Region {1} is up @ {2}-{3}", 68 m_log.DebugFormat("[REGION CACHE]: (on region {0}) Region {1} is up @ {2}-{3}",
65 m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); 69 m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
66 70
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 30c2223..b25be8e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -137,6 +137,8 @@ namespace OpenSim.Region.Framework.Scenes
137 protected IAssetService m_AssetService = null; 137 protected IAssetService m_AssetService = null;
138 protected IAuthorizationService m_AuthorizationService = null; 138 protected IAuthorizationService m_AuthorizationService = null;
139 139
140 private Object m_heartbeatLock = new Object();
141
140 public IAssetService AssetService 142 public IAssetService AssetService
141 { 143 {
142 get 144 get
@@ -940,6 +942,9 @@ namespace OpenSim.Region.Framework.Scenes
940 /// <param name="e"></param> 942 /// <param name="e"></param>
941 private void Heartbeat(object sender) 943 private void Heartbeat(object sender)
942 { 944 {
945 if (!Monitor.TryEnter(m_heartbeatLock))
946 return;
947
943 try 948 try
944 { 949 {
945 Update(); 950 Update();
@@ -950,6 +955,11 @@ namespace OpenSim.Region.Framework.Scenes
950 catch (ThreadAbortException) 955 catch (ThreadAbortException)
951 { 956 {
952 } 957 }
958 finally
959 {
960 Monitor.Pulse(m_heartbeatLock);
961 Monitor.Exit(m_heartbeatLock);
962 }
953 } 963 }
954 964
955 /// <summary> 965 /// <summary>
@@ -960,6 +970,12 @@ namespace OpenSim.Region.Framework.Scenes
960 int maintc = 0; 970 int maintc = 0;
961 while (!shuttingdown) 971 while (!shuttingdown)
962 { 972 {
973//#if DEBUG
974// int w = 0, io = 0;
975// ThreadPool.GetAvailableThreads(out w, out io);
976// if ((w < 10) || (io < 10))
977// m_log.DebugFormat("[WARNING]: ThreadPool reaching exhaustion. workers = {0}; io = {1}", w, io);
978//#endif
963 maintc = Environment.TickCount; 979 maintc = Environment.TickCount;
964 980
965 TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate; 981 TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate;
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 9d9735e..0964caa 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -260,7 +260,7 @@ namespace OpenSim.Server.Base
260 260
261 public static Dictionary<string, object> ParseXmlResponse(string data) 261 public static Dictionary<string, object> ParseXmlResponse(string data)
262 { 262 {
263 m_log.DebugFormat("[XXX]: received xml string: {0}", data); 263 //m_log.DebugFormat("[XXX]: received xml string: {0}", data);
264 264
265 Dictionary<string, object> ret = new Dictionary<string, object>(); 265 Dictionary<string, object> ret = new Dictionary<string, object>();
266 266
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
index ca45263..3c92209 100644
--- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
@@ -77,6 +77,7 @@ namespace OpenSim.Server.Handlers.Inventory
77 m_doLookup = serverConfig.GetBoolean("SessionAuthentication", false); 77 m_doLookup = serverConfig.GetBoolean("SessionAuthentication", false);
78 78
79 AddHttpHandlers(server); 79 AddHttpHandlers(server);
80 m_log.Debug("[INVENTORY HANDLER]: handlers initialized");
80 } 81 }
81 82
82 protected virtual void AddHttpHandlers(IHttpServer m_httpServer) 83 protected virtual void AddHttpHandlers(IHttpServer m_httpServer)
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
index 5443891..e047f71 100644
--- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs
@@ -416,13 +416,6 @@ namespace OpenSim.Services.Connectors
416 e.Source, e.Message); 416 e.Source, e.Message);
417 } 417 }
418 418
419 foreach (InventoryItemBase item in items)
420 {
421 InventoryItemBase itm = this.QueryItem(userID, item, sessionID);
422 itm.Name = item.Name;
423 itm.Folder = item.Folder;
424 this.UpdateItem(userID, itm, sessionID);
425 }
426 } 419 }
427 420
428 private void MoveItemsCompleted(IAsyncResult iar) 421 private void MoveItemsCompleted(IAsyncResult iar)