diff options
author | UbitUmarov | 2015-09-02 19:54:53 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-02 19:54:53 +0100 |
commit | a11edceb00b5b86f825bd957bdac9edb91f893dd (patch) | |
tree | c192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Framework | |
parent | bad merge? (diff) | |
download | opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2 opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz |
seems to compile ( tests comented out)
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/AssetBase.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/RestClient.cs | 29 | ||||
-rw-r--r-- | OpenSim/Framework/EstateSettings.cs | 37 | ||||
-rw-r--r-- | OpenSim/Framework/ISceneAgent.cs | 9 | ||||
-rw-r--r-- | OpenSim/Framework/PluginLoader.cs | 11 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 29 | ||||
-rw-r--r-- | OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | 131 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 182 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/Tests/OSHttpTests.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/UserProfileData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/UserProfiles.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 68 | ||||
-rw-r--r-- | OpenSim/Framework/VersionInfo.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 146 |
16 files changed, 151 insertions, 537 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 3937d9c..33be612 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -150,12 +150,8 @@ namespace OpenSim.Framework | |||
150 | Type == (sbyte)AssetType.Folder || | 150 | Type == (sbyte)AssetType.Folder || |
151 | Type == (sbyte)AssetType.ImageJPEG || | 151 | Type == (sbyte)AssetType.ImageJPEG || |
152 | Type == (sbyte)AssetType.ImageTGA || | 152 | Type == (sbyte)AssetType.ImageTGA || |
153 | <<<<<<< HEAD | ||
154 | Type == (sbyte)AssetType.LSLBytecode); | ||
155 | ======= | ||
156 | Type == (sbyte)AssetType.Mesh || | 153 | Type == (sbyte)AssetType.Mesh || |
157 | Type == (sbyte) AssetType.LSLBytecode); | 154 | Type == (sbyte) AssetType.LSLBytecode); |
158 | >>>>>>> avn/ubitvar | ||
159 | } | 155 | } |
160 | } | 156 | } |
161 | 157 | ||
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 4403f40..7c89e6b 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs | |||
@@ -395,26 +395,7 @@ namespace OpenSim.Framework.Communications | |||
395 | return null; | 395 | return null; |
396 | } | 396 | } |
397 | 397 | ||
398 | <<<<<<< HEAD | ||
399 | ======= | ||
400 | using (Stream src = _response.GetResponseStream()) | ||
401 | { | ||
402 | int length = src.Read(_readbuf, 0, BufferSize); | ||
403 | while (length > 0) | ||
404 | { | ||
405 | _resource.Write(_readbuf, 0, length); | ||
406 | length = src.Read(_readbuf, 0, BufferSize); | ||
407 | } | ||
408 | } | ||
409 | 398 | ||
410 | // TODO! Implement timeout, without killing the server | ||
411 | // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted | ||
412 | //ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); | ||
413 | |||
414 | // _allDone.WaitOne(); | ||
415 | if (_response != null) | ||
416 | _response.Close(); | ||
417 | >>>>>>> avn/ubitvar | ||
418 | if (_asyncException != null) | 399 | if (_asyncException != null) |
419 | throw _asyncException; | 400 | throw _asyncException; |
420 | 401 | ||
@@ -444,7 +425,6 @@ namespace OpenSim.Framework.Communications | |||
444 | auth.AddAuthorization(_request.Headers); | 425 | auth.AddAuthorization(_request.Headers); |
445 | 426 | ||
446 | src.Seek(0, SeekOrigin.Begin); | 427 | src.Seek(0, SeekOrigin.Begin); |
447 | <<<<<<< HEAD | ||
448 | 428 | ||
449 | int reqnum = WebUtil.RequestNumber++; | 429 | int reqnum = WebUtil.RequestNumber++; |
450 | if (WebUtil.DebugLevel >= 3) | 430 | if (WebUtil.DebugLevel >= 3) |
@@ -452,16 +432,7 @@ namespace OpenSim.Framework.Communications | |||
452 | if (WebUtil.DebugLevel >= 5) | 432 | if (WebUtil.DebugLevel >= 5) |
453 | WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src); | 433 | WebUtil.LogOutgoingDetail(string.Format("SEND {0}: ", reqnum), src); |
454 | 434 | ||
455 | Stream dst = _request.GetRequestStream(); | ||
456 | |||
457 | byte[] buf = new byte[1024]; | ||
458 | int length = src.Read(buf, 0, 1024); | ||
459 | while (length > 0) | ||
460 | ======= | ||
461 | m_log.Info("[REST]: Seek is ok"); | ||
462 | |||
463 | using (Stream dst = _request.GetRequestStream()) | 435 | using (Stream dst = _request.GetRequestStream()) |
464 | >>>>>>> avn/ubitvar | ||
465 | { | 436 | { |
466 | m_log.Info("[REST]: GetRequestStream is ok"); | 437 | m_log.Info("[REST]: GetRequestStream is ok"); |
467 | 438 | ||
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 3aec437..4c9f6e9 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs | |||
@@ -363,30 +363,43 @@ namespace OpenSim.Framework | |||
363 | return false; | 363 | return false; |
364 | } | 364 | } |
365 | 365 | ||
366 | public bool IsBanned(UUID avatarID) | ||
367 | { | ||
368 | if (!IsEstateManagerOrOwner(avatarID)) | ||
369 | { | ||
370 | foreach (EstateBan ban in l_EstateBans) | ||
371 | if (ban.BannedUserID == avatarID) | ||
372 | return true; | ||
373 | } | ||
374 | return false; | ||
375 | } | ||
376 | |||
366 | public bool IsBanned(UUID avatarID, int userFlags) | 377 | public bool IsBanned(UUID avatarID, int userFlags) |
367 | { | 378 | { |
368 | foreach (EstateBan ban in l_EstateBans) | 379 | if (!IsEstateManagerOrOwner(avatarID)) |
380 | { | ||
381 | foreach (EstateBan ban in l_EstateBans) | ||
369 | if (ban.BannedUserID == avatarID) | 382 | if (ban.BannedUserID == avatarID) |
370 | return true; | 383 | return true; |
371 | 384 | ||
372 | if (!IsEstateManagerOrOwner(avatarID) && !HasAccess(avatarID)) | 385 | if (!HasAccess(avatarID)) |
373 | { | ||
374 | if (DenyMinors) | ||
375 | { | 386 | { |
376 | if ((userFlags & 32) == 0) | 387 | if (DenyMinors) |
377 | { | 388 | { |
378 | return true; | 389 | if ((userFlags & 32) == 0) |
390 | { | ||
391 | return true; | ||
392 | } | ||
379 | } | 393 | } |
380 | } | 394 | if (DenyAnonymous) |
381 | if (DenyAnonymous) | ||
382 | { | ||
383 | if ((userFlags & 4) == 0) | ||
384 | { | 395 | { |
385 | return true; | 396 | if ((userFlags & 4) == 0) |
397 | { | ||
398 | return true; | ||
399 | } | ||
386 | } | 400 | } |
387 | } | 401 | } |
388 | } | 402 | } |
389 | |||
390 | return false; | 403 | return false; |
391 | } | 404 | } |
392 | 405 | ||
diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index ca1399c..be11931 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs | |||
@@ -66,19 +66,14 @@ namespace OpenSim.Framework | |||
66 | AvatarAppearance Appearance { get; set; } | 66 | AvatarAppearance Appearance { get; set; } |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// Set if initial data about the scene (avatars, objects) has been sent to the client. | ||
70 | /// </summary> | ||
71 | bool SentInitialDataToClient { get; } | ||
72 | |||
73 | /// <summary> | ||
74 | /// Send initial scene data to the client controlling this agent | 69 | /// Send initial scene data to the client controlling this agent |
75 | /// </summary> | 70 | /// </summary> |
76 | /// <remarks> | 71 | /// <remarks> |
77 | /// This includes scene object data and the appearance data of other avatars. | 72 | /// This includes scene object data and the appearance data of other avatars. |
78 | /// </remarks> | 73 | /// </remarks> |
79 | void SendInitialDataToClient(); | 74 | void SendInitialDataToMe(); |
80 | 75 | ||
81 | /// <summary> | 76 | /// <summary> |
82 | /// Direction in which the scene presence is looking. | 77 | /// Direction in which the scene presence is looking. |
83 | /// </summary> | 78 | /// </summary> |
84 | /// <remarks>Will be Vector3.Zero for a child agent.</remarks> | 79 | /// <remarks>Will be Vector3.Zero for a child agent.</remarks> |
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 5fa27d6..1e5e8bf 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -245,15 +245,6 @@ namespace OpenSim.Framework | |||
245 | // occasionally seems to corrupt its addin cache | 245 | // occasionally seems to corrupt its addin cache |
246 | // Hence, as a temporary solution we'll remove it before each startup | 246 | // Hence, as a temporary solution we'll remove it before each startup |
247 | 247 | ||
248 | <<<<<<< HEAD | ||
249 | try | ||
250 | { | ||
251 | if (Directory.Exists(dir + "/addin-db-000")) | ||
252 | Directory.Delete(dir + "/addin-db-000", true); | ||
253 | |||
254 | if (Directory.Exists(dir + "/addin-db-001")) | ||
255 | Directory.Delete(dir + "/addin-db-001", true); | ||
256 | ======= | ||
257 | string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY"); | 248 | string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY"); |
258 | string v0 = "addin-db-000"; | 249 | string v0 = "addin-db-000"; |
259 | string v1 = "addin-db-001"; | 250 | string v1 = "addin-db-001"; |
@@ -269,7 +260,7 @@ namespace OpenSim.Framework | |||
269 | 260 | ||
270 | if (Directory.Exists(v1)) | 261 | if (Directory.Exists(v1)) |
271 | Directory.Delete(v1, true); | 262 | Directory.Delete(v1, true); |
272 | >>>>>>> avn/ubitvar | 263 | |
273 | } | 264 | } |
274 | catch (IOException) | 265 | catch (IOException) |
275 | { | 266 | { |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index d75a6cf..ac77352 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -102,12 +102,11 @@ namespace OpenSim.Framework | |||
102 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 102 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
103 | private static readonly string LogHeader = "[REGION INFO]"; | 103 | private static readonly string LogHeader = "[REGION INFO]"; |
104 | 104 | ||
105 | <<<<<<< HEAD | 105 | |
106 | ======= | ||
107 | public bool commFailTF = false; | 106 | public bool commFailTF = false; |
108 | public ConfigurationMember configMember; | 107 | public ConfigurationMember configMember; |
109 | public string DataStore = String.Empty; | 108 | public string DataStore = String.Empty; |
110 | >>>>>>> avn/ubitvar | 109 | |
111 | public string RegionFile = String.Empty; | 110 | public string RegionFile = String.Empty; |
112 | public bool isSandbox = false; | 111 | public bool isSandbox = false; |
113 | public bool Persistent = true; | 112 | public bool Persistent = true; |
@@ -534,11 +533,7 @@ namespace OpenSim.Framework | |||
534 | return null; | 533 | return null; |
535 | } | 534 | } |
536 | 535 | ||
537 | <<<<<<< HEAD | ||
538 | private void SetExtraSetting(string key, string value) | ||
539 | ======= | ||
540 | public void SetExtraSetting(string key, string value) | 536 | public void SetExtraSetting(string key, string value) |
541 | >>>>>>> avn/ubitvar | ||
542 | { | 537 | { |
543 | string keylower = key.ToLower(); | 538 | string keylower = key.ToLower(); |
544 | m_extraSettings[keylower] = value; | 539 | m_extraSettings[keylower] = value; |
@@ -834,22 +829,16 @@ namespace OpenSim.Framework | |||
834 | string location = String.Format("{0},{1}", RegionLocX, RegionLocY); | 829 | string location = String.Format("{0},{1}", RegionLocX, RegionLocY); |
835 | config.Set("Location", location); | 830 | config.Set("Location", location); |
836 | 831 | ||
837 | <<<<<<< HEAD | ||
838 | if (RegionSizeX > 0) | ||
839 | ======= | ||
840 | if (DataStore != String.Empty) | 832 | if (DataStore != String.Empty) |
841 | config.Set("Datastore", DataStore); | 833 | config.Set("Datastore", DataStore); |
842 | 834 | ||
843 | if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize) | 835 | if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize) |
844 | { | 836 | { |
845 | >>>>>>> avn/ubitvar | ||
846 | config.Set("SizeX", RegionSizeX); | 837 | config.Set("SizeX", RegionSizeX); |
847 | |||
848 | if (RegionSizeY > 0) | ||
849 | config.Set("SizeY", RegionSizeY); | 838 | config.Set("SizeY", RegionSizeY); |
850 | 839 | // if (RegionSizeZ > 0) | |
851 | // if (RegionSizeZ > 0) | 840 | // config.Set("SizeZ", RegionSizeZ); |
852 | // config.Set("SizeZ", RegionSizeZ); | 841 | } |
853 | 842 | ||
854 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); | 843 | config.Set("InternalAddress", m_internalEndPoint.Address.ToString()); |
855 | config.Set("InternalPort", m_internalEndPoint.Port); | 844 | config.Set("InternalPort", m_internalEndPoint.Port); |
@@ -920,8 +909,6 @@ namespace OpenSim.Framework | |||
920 | throw new Exception("Invalid file type for region persistence."); | 909 | throw new Exception("Invalid file type for region persistence."); |
921 | } | 910 | } |
922 | 911 | ||
923 | <<<<<<< HEAD | ||
924 | ======= | ||
925 | public void loadConfigurationOptionsFromMe() | 912 | public void loadConfigurationOptionsFromMe() |
926 | { | 913 | { |
927 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE, | 914 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE, |
@@ -984,7 +971,7 @@ namespace OpenSim.Framework | |||
984 | "Max prims an object will hold", m_linksetCapacity.ToString(), true); | 971 | "Max prims an object will hold", m_linksetCapacity.ToString(), true); |
985 | 972 | ||
986 | configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | 973 | configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, |
987 | "Max avatars this sim will hold", m_agentCapacity.ToString(), true); | 974 | "Max avatars this sim will hold",AgentCapacity.ToString(), true); |
988 | 975 | ||
989 | configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, | 976 | configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, |
990 | "Scope ID for this region", ScopeID.ToString(), true); | 977 | "Scope ID for this region", ScopeID.ToString(), true); |
@@ -1131,7 +1118,7 @@ namespace OpenSim.Framework | |||
1131 | m_linksetCapacity = (int)configuration_result; | 1118 | m_linksetCapacity = (int)configuration_result; |
1132 | break; | 1119 | break; |
1133 | case "agent_capacity": | 1120 | case "agent_capacity": |
1134 | m_agentCapacity = (int)configuration_result; | 1121 | AgentCapacity = (int)configuration_result; |
1135 | break; | 1122 | break; |
1136 | case "scope_id": | 1123 | case "scope_id": |
1137 | ScopeID = (UUID)configuration_result; | 1124 | ScopeID = (UUID)configuration_result; |
@@ -1147,7 +1134,7 @@ namespace OpenSim.Framework | |||
1147 | return true; | 1134 | return true; |
1148 | } | 1135 | } |
1149 | 1136 | ||
1150 | >>>>>>> avn/ubitvar | 1137 | |
1151 | public void SaveLastMapUUID(UUID mapUUID) | 1138 | public void SaveLastMapUUID(UUID mapUUID) |
1152 | { | 1139 | { |
1153 | lastMapUUID = mapUUID; | 1140 | lastMapUUID = mapUUID; |
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index 487c087..098c4b9 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
58 | } | 58 | } |
59 | else | 59 | else |
60 | { | 60 | { |
61 | IConfig startupConfig = (IConfig) m_configSource.Configs["Startup"]; | 61 | IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; |
62 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); | 62 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); |
63 | bool allowRegionless = startupConfig.GetBoolean("allow_regionless", false); | 63 | bool allowRegionless = startupConfig.GetBoolean("allow_regionless", false); |
64 | 64 | ||
@@ -69,101 +69,74 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
69 | } | 69 | } |
70 | else | 70 | else |
71 | { | 71 | { |
72 | while(tries > 0) | 72 | while (tries > 0) |
73 | { | 73 | { |
74 | RegionInfo[] regionInfos = new RegionInfo[] {}; | 74 | RegionInfo[] regionInfos = new RegionInfo[] { }; |
75 | int regionCount = 0; | 75 | int regionCount = 0; |
76 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); | 76 | HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); |
77 | webRequest.Timeout = 30000; //30 Second Timeout | 77 | webRequest.Timeout = 30000; //30 Second Timeout |
78 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); | 78 | m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); |
79 | |||
80 | try | ||
81 | { | ||
82 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | ||
83 | m_log.Debug("[WEBLOADER]: Downloading region information..."); | ||
84 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
85 | string xmlSource = String.Empty; | ||
86 | string tempStr = reader.ReadLine(); | ||
87 | while (tempStr != null) | ||
88 | { | ||
89 | xmlSource = xmlSource + tempStr; | ||
90 | tempStr = reader.ReadLine(); | ||
91 | } | ||
92 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
93 | xmlSource.Length); | ||
94 | XmlDocument xmlDoc = new XmlDocument(); | ||
95 | xmlDoc.LoadXml(xmlSource); | ||
96 | if (xmlDoc.FirstChild.Name == "Nini") | ||
97 | { | ||
98 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; | ||
99 | |||
100 | if (regionCount > 0) | ||
101 | { | ||
102 | regionInfos = new RegionInfo[regionCount]; | ||
103 | int i; | ||
104 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | ||
105 | { | ||
106 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
107 | regionInfos[i] = | ||
108 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | catch (WebException ex) | ||
114 | { | ||
115 | if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) | ||
116 | { | ||
117 | if (!allowRegionless) | ||
118 | throw ex; | ||
119 | } | ||
120 | else | ||
121 | throw ex; | ||
122 | } | ||
123 | 79 | ||
124 | <<<<<<< HEAD | 80 | try |
125 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
126 | xmlSource.Length); | ||
127 | XmlDocument xmlDoc = new XmlDocument(); | ||
128 | xmlDoc.LoadXml(xmlSource); | ||
129 | if (xmlDoc.FirstChild.Name == "Nini") | ||
130 | { | 81 | { |
131 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; | 82 | HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); |
132 | 83 | m_log.Debug("[WEBLOADER]: Downloading region information..."); | |
133 | if (regionCount > 0) | 84 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); |
85 | string xmlSource = String.Empty; | ||
86 | string tempStr = reader.ReadLine(); | ||
87 | while (tempStr != null) | ||
88 | { | ||
89 | xmlSource = xmlSource + tempStr; | ||
90 | tempStr = reader.ReadLine(); | ||
91 | } | ||
92 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
93 | xmlSource.Length); | ||
94 | XmlDocument xmlDoc = new XmlDocument(); | ||
95 | xmlDoc.LoadXml(xmlSource); | ||
96 | if (xmlDoc.FirstChild.Name == "Nini") | ||
134 | { | 97 | { |
135 | regionInfos = new RegionInfo[regionCount]; | 98 | regionCount = xmlDoc.FirstChild.ChildNodes.Count; |
136 | int i; | 99 | |
137 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | 100 | if (regionCount > 0) |
138 | { | 101 | { |
139 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | 102 | regionInfos = new RegionInfo[regionCount]; |
140 | regionInfos[i] = | 103 | int i; |
141 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | 104 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) |
105 | { | ||
106 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
107 | regionInfos[i] = | ||
108 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i], false, m_configSource); | ||
109 | } | ||
142 | } | 110 | } |
143 | } | 111 | } |
144 | } | 112 | } |
145 | } | 113 | catch (WebException ex) |
146 | catch (WebException ex) | 114 | { |
147 | { | 115 | if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) |
148 | using (HttpWebResponse response = (HttpWebResponse)ex.Response) | 116 | { |
149 | ======= | 117 | if (!allowRegionless) |
150 | if (regionCount > 0 | allowRegionless) | 118 | throw ex; |
151 | return regionInfos; | 119 | } |
120 | else | ||
121 | throw ex; | ||
122 | } | ||
123 | |||
124 | if (regionCount > 0 | allowRegionless) | ||
125 | return regionInfos; | ||
152 | 126 | ||
153 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); | 127 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); |
154 | tries--; | 128 | tries--; |
155 | if (tries > 0) | 129 | if (tries > 0) |
156 | >>>>>>> avn/ubitvar | ||
157 | { | 130 | { |
158 | m_log.Debug("[WEBLOADER]: Retrying"); | 131 | m_log.Debug("[WEBLOADER]: Retrying"); |
159 | System.Threading.Thread.Sleep(wait); | 132 | System.Threading.Thread.Sleep(wait); |
160 | } | 133 | } |
161 | } | 134 | } |
162 | 135 | ||
163 | m_log.Error("[WEBLOADER]: No region configs were available."); | 136 | m_log.Error("[WEBLOADER]: No region configs were available."); |
164 | return null; | 137 | return null; |
165 | } | 138 | } |
166 | } | 139 | } |
167 | } | 140 | } |
168 | } | 141 | } |
169 | } | 142 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 60702d4..09b0801 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -65,12 +65,9 @@ namespace OpenSim.Framework.Servers | |||
65 | /// This will control a periodic log printout of the current 'show stats' (if they are active) for this | 65 | /// This will control a periodic log printout of the current 'show stats' (if they are active) for this |
66 | /// server. | 66 | /// server. |
67 | /// </summary> | 67 | /// </summary> |
68 | <<<<<<< HEAD | 68 | |
69 | private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; | 69 | private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; |
70 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); | 70 | private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); |
71 | ======= | ||
72 | // private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); | ||
73 | >>>>>>> avn/ubitvar | ||
74 | 71 | ||
75 | /// <summary> | 72 | /// <summary> |
76 | /// Random uuid for private data | 73 | /// Random uuid for private data |
@@ -88,11 +85,8 @@ namespace OpenSim.Framework.Servers | |||
88 | // Random uuid for private data | 85 | // Random uuid for private data |
89 | m_osSecret = UUID.Random().ToString(); | 86 | m_osSecret = UUID.Random().ToString(); |
90 | 87 | ||
91 | <<<<<<< HEAD | 88 | m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); |
92 | ======= | 89 | m_periodicDiagnosticsTimer.Enabled = true; |
93 | // m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); | ||
94 | // m_periodicDiagnosticsTimer.Enabled = true; | ||
95 | >>>>>>> avn/ubitvar | ||
96 | } | 90 | } |
97 | 91 | ||
98 | /// <summary> | 92 | /// <summary> |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 616c673..85976ab 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1947,14 +1947,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1947 | m_httpListener2.Start(64); | 1947 | m_httpListener2.Start(64); |
1948 | 1948 | ||
1949 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events | 1949 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events |
1950 | <<<<<<< HEAD | 1950 | |
1951 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 3, 25000); | 1951 | PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 3, 25000); |
1952 | PollServiceRequestManager.Start(); | 1952 | PollServiceRequestManager.Start(); |
1953 | 1953 | ||
1954 | ======= | ||
1955 | m_PollServiceManager = new PollServiceRequestManager(this, 4, 25000); | ||
1956 | m_PollServiceManager.Start(); | ||
1957 | >>>>>>> avn/ubitvar | ||
1958 | HTTPDRunning = true; | 1954 | HTTPDRunning = true; |
1959 | 1955 | ||
1960 | //HttpListenerContext context; | 1956 | //HttpListenerContext context; |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 4ffe6e5..571e8d8 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -74,16 +74,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
74 | private Thread[] m_workerThreads; | 74 | private Thread[] m_workerThreads; |
75 | private Thread m_retrysThread; | 75 | private Thread m_retrysThread; |
76 | 76 | ||
77 | <<<<<<< HEAD | ||
78 | private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); | ||
79 | |||
80 | // private int m_timeout = 1000; // increase timeout 250; now use the event one | ||
81 | ======= | ||
82 | private bool m_running = true; | 77 | private bool m_running = true; |
83 | private int slowCount = 0; | 78 | private int slowCount = 0; |
84 | 79 | ||
85 | private SmartThreadPool m_threadPool; | 80 | private SmartThreadPool m_threadPool; |
86 | >>>>>>> avn/ubitvar | 81 | |
87 | 82 | ||
88 | public PollServiceRequestManager( | 83 | public PollServiceRequestManager( |
89 | BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) | 84 | BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) |
@@ -93,7 +88,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
93 | m_WorkerThreadCount = pWorkerThreadCount; | 88 | m_WorkerThreadCount = pWorkerThreadCount; |
94 | m_workerThreads = new Thread[m_WorkerThreadCount]; | 89 | m_workerThreads = new Thread[m_WorkerThreadCount]; |
95 | 90 | ||
96 | <<<<<<< HEAD | 91 | /* |
97 | StatsManager.RegisterStat( | 92 | StatsManager.RegisterStat( |
98 | new Stat( | 93 | new Stat( |
99 | "QueuedPollResponses", | 94 | "QueuedPollResponses", |
@@ -119,7 +114,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
119 | MeasuresOfInterest.AverageChangeOverTime, | 114 | MeasuresOfInterest.AverageChangeOverTime, |
120 | stat => stat.Value = ResponsesProcessed, | 115 | stat => stat.Value = ResponsesProcessed, |
121 | StatVerbosity.Debug)); | 116 | StatVerbosity.Debug)); |
122 | ======= | 117 | */ |
123 | PollServiceHttpRequestComparer preqCp = new PollServiceHttpRequestComparer(); | 118 | PollServiceHttpRequestComparer preqCp = new PollServiceHttpRequestComparer(); |
124 | m_bycontext = new Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>>(preqCp); | 119 | m_bycontext = new Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>>(preqCp); |
125 | 120 | ||
@@ -132,46 +127,16 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
132 | startInfo.ThreadPoolName = "PoolService"; | 127 | startInfo.ThreadPoolName = "PoolService"; |
133 | 128 | ||
134 | m_threadPool = new SmartThreadPool(startInfo); | 129 | m_threadPool = new SmartThreadPool(startInfo); |
135 | >>>>>>> avn/ubitvar | ||
136 | } | 130 | } |
137 | 131 | ||
138 | public void Start() | 132 | public void Start() |
139 | { | 133 | { |
140 | <<<<<<< HEAD | ||
141 | IsRunning = true; | ||
142 | |||
143 | if (PerformResponsesAsync) | ||
144 | { | ||
145 | //startup worker threads | ||
146 | for (uint i = 0; i < m_WorkerThreadCount; i++) | ||
147 | { | ||
148 | m_workerThreads[i] | ||
149 | = WorkManager.StartThread( | ||
150 | PoolWorkerJob, | ||
151 | string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port), | ||
152 | ThreadPriority.Normal, | ||
153 | false, | ||
154 | false, | ||
155 | null, | ||
156 | int.MaxValue); | ||
157 | } | ||
158 | |||
159 | WorkManager.StartThread( | ||
160 | this.CheckLongPollThreads, | ||
161 | string.Format("LongPollServiceWatcherThread:{0}", m_server.Port), | ||
162 | ThreadPriority.Normal, | ||
163 | false, | ||
164 | true, | ||
165 | null, | ||
166 | 1000 * 60 * 10); | ||
167 | } | ||
168 | ======= | ||
169 | m_threadPool.Start(); | 134 | m_threadPool.Start(); |
170 | //startup worker threads | 135 | //startup worker threads |
171 | for (uint i = 0; i < m_WorkerThreadCount; i++) | 136 | for (uint i = 0; i < m_WorkerThreadCount; i++) |
172 | { | 137 | { |
173 | m_workerThreads[i] | 138 | m_workerThreads[i] |
174 | = Watchdog.StartThread( | 139 | = WorkManager.StartThread( |
175 | PoolWorkerJob, | 140 | PoolWorkerJob, |
176 | string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port), | 141 | string.Format("PollServiceWorkerThread {0}:{1}", i, m_server.Port), |
177 | ThreadPriority.Normal, | 142 | ThreadPriority.Normal, |
@@ -181,7 +146,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
181 | int.MaxValue); | 146 | int.MaxValue); |
182 | } | 147 | } |
183 | 148 | ||
184 | m_retrysThread = Watchdog.StartThread( | 149 | m_retrysThread = WorkManager.StartThread( |
185 | this.CheckRetries, | 150 | this.CheckRetries, |
186 | string.Format("PollServiceWatcherThread:{0}", m_server.Port), | 151 | string.Format("PollServiceWatcherThread:{0}", m_server.Port), |
187 | ThreadPriority.Normal, | 152 | ThreadPriority.Normal, |
@@ -189,7 +154,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
189 | true, | 154 | true, |
190 | null, | 155 | null, |
191 | 1000 * 60 * 10); | 156 | 1000 * 60 * 10); |
192 | >>>>>>> avn/ubitvar | 157 | |
193 | } | 158 | } |
194 | 159 | ||
195 | private void ReQueueEvent(PollServiceHttpRequest req) | 160 | private void ReQueueEvent(PollServiceHttpRequest req) |
@@ -258,36 +223,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
258 | 223 | ||
259 | private void CheckRetries() | 224 | private void CheckRetries() |
260 | { | 225 | { |
261 | <<<<<<< HEAD | ||
262 | // The only purpose of this thread is to check the EQs for events. | ||
263 | // If there are events, that thread will be placed in the "ready-to-serve" queue, m_requests. | ||
264 | // If there are no events, that thread will be back to its "waiting" queue, m_longPollRequests. | ||
265 | // All other types of tasks (Inventory handlers, http-in, etc) don't have the long-poll nature, | ||
266 | // so if they aren't ready to be served by a worker thread (no events), they are placed | ||
267 | // directly back in the "ready-to-serve" queue by the worker thread. | ||
268 | while (IsRunning) | ||
269 | ======= | ||
270 | while (m_running) | 226 | while (m_running) |
271 | >>>>>>> avn/ubitvar | 227 | |
272 | { | 228 | { |
273 | Thread.Sleep(100); // let the world move .. back to faster rate | 229 | Thread.Sleep(100); // let the world move .. back to faster rate |
274 | Watchdog.UpdateThread(); | 230 | Watchdog.UpdateThread(); |
275 | lock (m_retryRequests) | 231 | lock (m_retryRequests) |
276 | { | 232 | { |
277 | <<<<<<< HEAD | ||
278 | if (m_longPollRequests.Count > 0 && IsRunning) | ||
279 | { | ||
280 | List<PollServiceHttpRequest> ready = m_longPollRequests.FindAll(req => | ||
281 | (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ | ||
282 | (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout | ||
283 | ); | ||
284 | |||
285 | ready.ForEach(req => | ||
286 | { | ||
287 | m_requests.Enqueue(req); | ||
288 | m_longPollRequests.Remove(req); | ||
289 | }); | ||
290 | ======= | ||
291 | while (m_retryRequests.Count > 0 && m_running) | 233 | while (m_retryRequests.Count > 0 && m_running) |
292 | m_requests.Enqueue(m_retryRequests.Dequeue()); | 234 | m_requests.Enqueue(m_retryRequests.Dequeue()); |
293 | } | 235 | } |
@@ -295,7 +237,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
295 | if (slowCount >= 10) | 237 | if (slowCount >= 10) |
296 | { | 238 | { |
297 | slowCount = 0; | 239 | slowCount = 0; |
298 | >>>>>>> avn/ubitvar | ||
299 | 240 | ||
300 | lock (m_slowRequests) | 241 | lock (m_slowRequests) |
301 | { | 242 | { |
@@ -308,12 +249,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
308 | 249 | ||
309 | public void Stop() | 250 | public void Stop() |
310 | { | 251 | { |
311 | <<<<<<< HEAD | ||
312 | IsRunning = false; | ||
313 | // m_timeout = -10000; // cause all to expire | ||
314 | ======= | ||
315 | m_running = false; | 252 | m_running = false; |
316 | >>>>>>> avn/ubitvar | 253 | |
317 | Thread.Sleep(1000); // let the world move | 254 | Thread.Sleep(1000); // let the world move |
318 | 255 | ||
319 | foreach (Thread t in m_workerThreads) | 256 | foreach (Thread t in m_workerThreads) |
@@ -341,13 +278,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
341 | 278 | ||
342 | lock (m_slowRequests) | 279 | lock (m_slowRequests) |
343 | { | 280 | { |
344 | <<<<<<< HEAD | ||
345 | if (m_longPollRequests.Count > 0 && IsRunning) | ||
346 | m_longPollRequests.ForEach(req => m_requests.Enqueue(req)); | ||
347 | ======= | ||
348 | while (m_slowRequests.Count > 0) | 281 | while (m_slowRequests.Count > 0) |
349 | m_requests.Enqueue(m_slowRequests.Dequeue()); | 282 | m_requests.Enqueue(m_slowRequests.Dequeue()); |
350 | >>>>>>> avn/ubitvar | 283 | |
351 | } | 284 | } |
352 | 285 | ||
353 | while (m_requests.Count() > 0) | 286 | while (m_requests.Count() > 0) |
@@ -355,13 +288,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
355 | try | 288 | try |
356 | { | 289 | { |
357 | wreq = m_requests.Dequeue(0); | 290 | wreq = m_requests.Dequeue(0); |
358 | <<<<<<< HEAD | ||
359 | ResponsesProcessed++; | ||
360 | wreq.DoHTTPGruntWork( | ||
361 | m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); | ||
362 | ======= | ||
363 | wreq.DoHTTPstop(m_server); | 291 | wreq.DoHTTPstop(m_server); |
364 | >>>>>>> avn/ubitvar | 292 | |
365 | } | 293 | } |
366 | catch | 294 | catch |
367 | { | 295 | { |
@@ -375,91 +303,35 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
375 | 303 | ||
376 | private void PoolWorkerJob() | 304 | private void PoolWorkerJob() |
377 | { | 305 | { |
378 | while (IsRunning) | 306 | while (m_running) |
379 | { | 307 | { |
380 | <<<<<<< HEAD | ||
381 | ======= | ||
382 | PollServiceHttpRequest req = m_requests.Dequeue(5000); | 308 | PollServiceHttpRequest req = m_requests.Dequeue(5000); |
383 | 309 | ||
384 | >>>>>>> avn/ubitvar | ||
385 | Watchdog.UpdateThread(); | 310 | Watchdog.UpdateThread(); |
386 | WaitPerformResponse(); | 311 | if (req != null) |
387 | } | ||
388 | } | ||
389 | |||
390 | public void WaitPerformResponse() | ||
391 | { | ||
392 | PollServiceHttpRequest req = m_requests.Dequeue(5000); | ||
393 | // m_log.DebugFormat("[YYY]: Dequeued {0}", (req == null ? "null" : req.PollServiceArgs.Type.ToString())); | ||
394 | |||
395 | if (req != null) | ||
396 | { | ||
397 | try | ||
398 | { | 312 | { |
399 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | 313 | try |
400 | { | 314 | { |
401 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); | 315 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) |
402 | |||
403 | <<<<<<< HEAD | ||
404 | if (responsedata == null) | ||
405 | return; | ||
406 | |||
407 | // This is the event queue. | ||
408 | // Even if we're not running we can still perform responses by explicit request. | ||
409 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll | ||
410 | || !PerformResponsesAsync) | ||
411 | { | 316 | { |
412 | try | 317 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id); |
413 | { | 318 | |
414 | ResponsesProcessed++; | ||
415 | req.DoHTTPGruntWork(m_server, responsedata); | ||
416 | } | ||
417 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream | ||
418 | { | ||
419 | // Ignore it, no need to reply | ||
420 | m_log.Error(e); | ||
421 | } | ||
422 | } | ||
423 | else | ||
424 | { | ||
425 | m_threadPool.QueueWorkItem(x => | ||
426 | ======= | ||
427 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue | 319 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue |
428 | >>>>>>> avn/ubitvar | ||
429 | { | 320 | { |
430 | try | 321 | try |
431 | { | 322 | { |
432 | ResponsesProcessed++; | ||
433 | req.DoHTTPGruntWork(m_server, responsedata); | 323 | req.DoHTTPGruntWork(m_server, responsedata); |
434 | byContextDequeue(req); | 324 | byContextDequeue(req); |
435 | } | 325 | } |
436 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream | 326 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream |
437 | { | 327 | { |
438 | // Ignore it, no need to reply | 328 | // Ignore it, no need to reply |
439 | m_log.Error(e); | ||
440 | } | 329 | } |
441 | catch (Exception e) | 330 | } |
331 | else | ||
332 | { | ||
333 | m_threadPool.QueueWorkItem(x => | ||
442 | { | 334 | { |
443 | <<<<<<< HEAD | ||
444 | m_log.Error(e); | ||
445 | } | ||
446 | |||
447 | return null; | ||
448 | }, null); | ||
449 | } | ||
450 | } | ||
451 | else | ||
452 | { | ||
453 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | ||
454 | { | ||
455 | ResponsesProcessed++; | ||
456 | req.DoHTTPGruntWork( | ||
457 | m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | ||
458 | } | ||
459 | else | ||
460 | { | ||
461 | ReQueueEvent(req); | ||
462 | ======= | ||
463 | try | 335 | try |
464 | { | 336 | { |
465 | req.DoHTTPGruntWork(m_server, responsedata); | 337 | req.DoHTTPGruntWork(m_server, responsedata); |
@@ -478,7 +350,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
478 | { | 350 | { |
479 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 351 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
480 | { | 352 | { |
481 | req.DoHTTPGruntWork(m_server, | 353 | req.DoHTTPGruntWork(m_server, |
482 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 354 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
483 | byContextDequeue(req); | 355 | byContextDequeue(req); |
484 | } | 356 | } |
@@ -486,17 +358,15 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
486 | { | 358 | { |
487 | ReQueueEvent(req); | 359 | ReQueueEvent(req); |
488 | } | 360 | } |
489 | >>>>>>> avn/ubitvar | ||
490 | } | 361 | } |
491 | } | 362 | } |
492 | } | 363 | catch (Exception e) |
493 | catch (Exception e) | 364 | { |
494 | { | 365 | m_log.ErrorFormat("Exception in poll service thread: " + e.ToString()); |
495 | m_log.ErrorFormat("Exception in poll service thread: " + e.ToString()); | 366 | } |
496 | } | 367 | } |
497 | } | 368 | } |
498 | } | 369 | } |
499 | 370 | ||
500 | } | 371 | } |
501 | } | 372 | } |
502 | |||
diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs index e13551c..1b47cc6 100644 --- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs +++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs | |||
@@ -41,9 +41,6 @@ namespace OpenSim.Framework.Servers.Tests | |||
41 | { | 41 | { |
42 | [TestFixture] | 42 | [TestFixture] |
43 | public class OSHttpTests : OpenSimTestCase | 43 | public class OSHttpTests : OpenSimTestCase |
44 | <<<<<<< HEAD | ||
45 | { | ||
46 | ======= | ||
47 | { | 44 | { |
48 | // we need an IHttpClientContext for our tests | 45 | // we need an IHttpClientContext for our tests |
49 | public class TestHttpClientContext: IHttpClientContext | 46 | public class TestHttpClientContext: IHttpClientContext |
@@ -363,9 +360,8 @@ namespace OpenSim.Framework.Servers.Tests | |||
363 | public void Redirect(Uri uri) {} | 360 | public void Redirect(Uri uri) {} |
364 | public void Redirect(string url) {} | 361 | public void Redirect(string url) {} |
365 | } | 362 | } |
363 | |||
366 | 364 | ||
367 | |||
368 | >>>>>>> avn/ubitvar | ||
369 | public OSHttpRequest req0; | 365 | public OSHttpRequest req0; |
370 | public OSHttpRequest req1; | 366 | public OSHttpRequest req1; |
371 | 367 | ||
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 61d8fe5..f7069a5 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs | |||
@@ -160,11 +160,7 @@ namespace OpenSim.Framework | |||
160 | public virtual ulong HomeRegion | 160 | public virtual ulong HomeRegion |
161 | { | 161 | { |
162 | get | 162 | get |
163 | <<<<<<< HEAD | ||
164 | { | ||
165 | ======= | ||
166 | { | 163 | { |
167 | >>>>>>> avn/ubitvar | ||
168 | return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY)); | 164 | return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY)); |
169 | // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); | 165 | // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); |
170 | } | 166 | } |
diff --git a/OpenSim/Framework/UserProfiles.cs b/OpenSim/Framework/UserProfiles.cs index 944a492..98ab651 100644 --- a/OpenSim/Framework/UserProfiles.cs +++ b/OpenSim/Framework/UserProfiles.cs | |||
@@ -91,6 +91,14 @@ namespace OpenSim.Framework | |||
91 | public UUID TargetId; | 91 | public UUID TargetId; |
92 | public string Notes; | 92 | public string Notes; |
93 | } | 93 | } |
94 | |||
95 | public class UserPreferences | ||
96 | { | ||
97 | public UUID UserId; | ||
98 | public bool IMViaEmail = false; | ||
99 | public bool Visible = false; | ||
100 | public string EMail = string.Empty; | ||
101 | } | ||
94 | 102 | ||
95 | public class UserAccountProperties | 103 | public class UserAccountProperties |
96 | { | 104 | { |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index eb3526a..77985bd 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1688,69 +1688,6 @@ namespace OpenSim.Framework | |||
1688 | return displayConnectionString; | 1688 | return displayConnectionString; |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | public static T ReadSettingsFromIniFile<T>(IConfig config, T settingsClass) | ||
1692 | { | ||
1693 | Type settingsType = settingsClass.GetType(); | ||
1694 | |||
1695 | FieldInfo[] fieldInfos = settingsType.GetFields(); | ||
1696 | foreach (FieldInfo fieldInfo in fieldInfos) | ||
1697 | { | ||
1698 | if (!fieldInfo.IsStatic) | ||
1699 | { | ||
1700 | if (fieldInfo.FieldType == typeof(System.String)) | ||
1701 | { | ||
1702 | fieldInfo.SetValue(settingsClass, config.Get(fieldInfo.Name, (string)fieldInfo.GetValue(settingsClass))); | ||
1703 | } | ||
1704 | else if (fieldInfo.FieldType == typeof(System.Boolean)) | ||
1705 | { | ||
1706 | fieldInfo.SetValue(settingsClass, config.GetBoolean(fieldInfo.Name, (bool)fieldInfo.GetValue(settingsClass))); | ||
1707 | } | ||
1708 | else if (fieldInfo.FieldType == typeof(System.Int32)) | ||
1709 | { | ||
1710 | fieldInfo.SetValue(settingsClass, config.GetInt(fieldInfo.Name, (int)fieldInfo.GetValue(settingsClass))); | ||
1711 | } | ||
1712 | else if (fieldInfo.FieldType == typeof(System.Single)) | ||
1713 | { | ||
1714 | fieldInfo.SetValue(settingsClass, config.GetFloat(fieldInfo.Name, (float)fieldInfo.GetValue(settingsClass))); | ||
1715 | } | ||
1716 | else if (fieldInfo.FieldType == typeof(System.UInt32)) | ||
1717 | { | ||
1718 | fieldInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(fieldInfo.Name, ((uint)fieldInfo.GetValue(settingsClass)).ToString()))); | ||
1719 | } | ||
1720 | } | ||
1721 | } | ||
1722 | |||
1723 | PropertyInfo[] propertyInfos = settingsType.GetProperties(); | ||
1724 | foreach (PropertyInfo propInfo in propertyInfos) | ||
1725 | { | ||
1726 | if ((propInfo.CanRead) && (propInfo.CanWrite)) | ||
1727 | { | ||
1728 | if (propInfo.PropertyType == typeof(System.String)) | ||
1729 | { | ||
1730 | propInfo.SetValue(settingsClass, config.Get(propInfo.Name, (string)propInfo.GetValue(settingsClass, null)), null); | ||
1731 | } | ||
1732 | else if (propInfo.PropertyType == typeof(System.Boolean)) | ||
1733 | { | ||
1734 | propInfo.SetValue(settingsClass, config.GetBoolean(propInfo.Name, (bool)propInfo.GetValue(settingsClass, null)), null); | ||
1735 | } | ||
1736 | else if (propInfo.PropertyType == typeof(System.Int32)) | ||
1737 | { | ||
1738 | propInfo.SetValue(settingsClass, config.GetInt(propInfo.Name, (int)propInfo.GetValue(settingsClass, null)), null); | ||
1739 | } | ||
1740 | else if (propInfo.PropertyType == typeof(System.Single)) | ||
1741 | { | ||
1742 | propInfo.SetValue(settingsClass, config.GetFloat(propInfo.Name, (float)propInfo.GetValue(settingsClass, null)), null); | ||
1743 | } | ||
1744 | if (propInfo.PropertyType == typeof(System.UInt32)) | ||
1745 | { | ||
1746 | propInfo.SetValue(settingsClass, Convert.ToUInt32(config.Get(propInfo.Name, ((uint)propInfo.GetValue(settingsClass, null)).ToString())), null); | ||
1747 | } | ||
1748 | } | ||
1749 | } | ||
1750 | |||
1751 | return settingsClass; | ||
1752 | } | ||
1753 | |||
1754 | public static string Base64ToString(string str) | 1691 | public static string Base64ToString(string str) |
1755 | { | 1692 | { |
1756 | Decoder utf8Decode = Encoding.UTF8.GetDecoder(); | 1693 | Decoder utf8Decode = Encoding.UTF8.GetDecoder(); |
@@ -2156,11 +2093,6 @@ namespace OpenSim.Framework | |||
2156 | } | 2093 | } |
2157 | } | 2094 | } |
2158 | 2095 | ||
2159 | public static void FireAndForget(System.Threading.WaitCallback callback) | ||
2160 | { | ||
2161 | FireAndForget(callback, null); | ||
2162 | } | ||
2163 | |||
2164 | public static void InitThreadPool(int minThreads, int maxThreads) | 2096 | public static void InitThreadPool(int minThreads, int maxThreads) |
2165 | { | 2097 | { |
2166 | if (maxThreads < 2) | 2098 | if (maxThreads < 2) |
diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs index ea99444..f0ea96f 100644 --- a/OpenSim/Framework/VersionInfo.cs +++ b/OpenSim/Framework/VersionInfo.cs | |||
@@ -29,11 +29,7 @@ namespace OpenSim | |||
29 | { | 29 | { |
30 | public class VersionInfo | 30 | public class VersionInfo |
31 | { | 31 | { |
32 | <<<<<<< HEAD:OpenSim/Framework/VersionInfo.cs | 32 | public const string VersionNumber = "0.8.2.0CM"; |
33 | public const string VersionNumber = "0.8.2.0"; | ||
34 | ======= | ||
35 | private const string VERSION_NUMBER = "0.8.0CM"; | ||
36 | >>>>>>> avn/ubitvar:OpenSim/Framework/Servers/VersionInfo.cs | ||
37 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; | 33 | private const Flavour VERSION_FLAVOUR = Flavour.Dev; |
38 | 34 | ||
39 | public enum Flavour | 35 | public enum Flavour |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 94b5230..44d9318 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -205,16 +205,8 @@ namespace OpenSim.Framework | |||
205 | { | 205 | { |
206 | if (DebugLevel == 5) | 206 | if (DebugLevel == 5) |
207 | { | 207 | { |
208 | <<<<<<< HEAD | ||
209 | if (output.Length > MaxRequestDiagLength) | 208 | if (output.Length > MaxRequestDiagLength) |
210 | output = output.Substring(0, MaxRequestDiagLength) + "..."; | 209 | output = output.Substring(0, MaxRequestDiagLength) + "..."; |
211 | ======= | ||
212 | int len = output.Length; | ||
213 | if(len > 80) | ||
214 | len = 80; | ||
215 | output = output.Substring(0, len); | ||
216 | output = output + "..."; | ||
217 | >>>>>>> avn/ubitvar | ||
218 | } | 210 | } |
219 | 211 | ||
220 | m_log.DebugFormat("[LOGHTTP]: {0}{1}", context, Util.BinaryToASCII(output)); | 212 | m_log.DebugFormat("[LOGHTTP]: {0}{1}", context, Util.BinaryToASCII(output)); |
@@ -295,12 +287,9 @@ namespace OpenSim.Framework | |||
295 | } | 287 | } |
296 | else | 288 | else |
297 | { | 289 | { |
298 | <<<<<<< HEAD | ||
299 | ======= | ||
300 | tickcompressdata = tickJsondata; | 290 | tickcompressdata = tickJsondata; |
301 | compsize = buffer.Length; | 291 | compsize = buffer.Length; |
302 | request.ContentType = "application/json"; | 292 | |
303 | >>>>>>> avn/ubitvar | ||
304 | request.ContentLength = buffer.Length; //Count bytes to send | 293 | request.ContentLength = buffer.Length; //Count bytes to send |
305 | using (Stream requestStream = request.GetRequestStream()) | 294 | using (Stream requestStream = request.GetRequestStream()) |
306 | requestStream.Write(buffer, 0, buffer.Length); //Send it | 295 | requestStream.Write(buffer, 0, buffer.Length); //Send it |
@@ -315,7 +304,6 @@ namespace OpenSim.Framework | |||
315 | { | 304 | { |
316 | using (Stream responseStream = response.GetResponseStream()) | 305 | using (Stream responseStream = response.GetResponseStream()) |
317 | { | 306 | { |
318 | <<<<<<< HEAD | ||
319 | using (StreamReader reader = new StreamReader(responseStream)) | 307 | using (StreamReader reader = new StreamReader(responseStream)) |
320 | { | 308 | { |
321 | string responseStr = reader.ReadToEnd(); | 309 | string responseStr = reader.ReadToEnd(); |
@@ -323,12 +311,6 @@ namespace OpenSim.Framework | |||
323 | WebUtil.LogResponseDetail(reqnum, responseStr); | 311 | WebUtil.LogResponseDetail(reqnum, responseStr); |
324 | return CanonicalizeResults(responseStr); | 312 | return CanonicalizeResults(responseStr); |
325 | } | 313 | } |
326 | ======= | ||
327 | string responseStr = null; | ||
328 | responseStr = responseStream.GetStreamString(); | ||
329 | //m_log.DebugFormat("[WEB UTIL]: <{0}> response is <{1}>",reqnum,responseStr); | ||
330 | return CanonicalizeResults(responseStr); | ||
331 | >>>>>>> avn/ubitvar | ||
332 | } | 314 | } |
333 | } | 315 | } |
334 | } | 316 | } |
@@ -352,10 +334,6 @@ namespace OpenSim.Framework | |||
352 | if (tickdiff > LongCallTime) | 334 | if (tickdiff > LongCallTime) |
353 | { | 335 | { |
354 | m_log.InfoFormat( | 336 | m_log.InfoFormat( |
355 | <<<<<<< HEAD | ||
356 | "[LOGHTTP]: Slow JSON-RPC request {0} {1} to {2} took {3}ms, {4}ms writing, {5}", | ||
357 | reqnum, method, url, tickdiff, tickdata, | ||
358 | ======= | ||
359 | "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing({5} at Json; {6} at comp), {7} bytes ({8} uncomp): {9}", | 337 | "[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing({5} at Json; {6} at comp), {7} bytes ({8} uncomp): {9}", |
360 | reqnum, | 338 | reqnum, |
361 | method, | 339 | method, |
@@ -366,7 +344,7 @@ namespace OpenSim.Framework | |||
366 | tickcompressdata, | 344 | tickcompressdata, |
367 | compsize, | 345 | compsize, |
368 | strBuffer != null ? strBuffer.Length : 0, | 346 | strBuffer != null ? strBuffer.Length : 0, |
369 | >>>>>>> avn/ubitvar | 347 | |
370 | strBuffer != null | 348 | strBuffer != null |
371 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) | 349 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) |
372 | : ""); | 350 | : ""); |
@@ -823,6 +801,20 @@ namespace OpenSim.Framework | |||
823 | MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, action, maxConnections, null); | 801 | MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, action, maxConnections, null); |
824 | } | 802 | } |
825 | 803 | ||
804 | /// <summary> | ||
805 | /// Perform a synchronous REST request. | ||
806 | /// </summary> | ||
807 | /// <param name="verb"></param> | ||
808 | /// <param name="requestUrl"></param> | ||
809 | /// <param name="obj"></param> | ||
810 | /// <param name="pTimeout"> | ||
811 | /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) | ||
812 | /// </param> | ||
813 | /// <param name="maxConnections"></param> | ||
814 | /// <returns> | ||
815 | /// The response. If there was an internal exception or the request timed out, | ||
816 | /// then the default(TResponse) is returned. | ||
817 | /// </returns> | ||
826 | public static void MakeRequest<TRequest, TResponse>(string verb, | 818 | public static void MakeRequest<TRequest, TResponse>(string verb, |
827 | string requestUrl, TRequest obj, Action<TResponse> action, | 819 | string requestUrl, TRequest obj, Action<TResponse> action, |
828 | int maxConnections, IServiceAuth auth) | 820 | int maxConnections, IServiceAuth auth) |
@@ -834,7 +826,7 @@ namespace OpenSim.Framework | |||
834 | reqnum, verb, requestUrl); | 826 | reqnum, verb, requestUrl); |
835 | 827 | ||
836 | int tickstart = Util.EnvironmentTickCount(); | 828 | int tickstart = Util.EnvironmentTickCount(); |
837 | // int tickdata = 0; | 829 | int tickdata = 0; |
838 | int tickdiff = 0; | 830 | int tickdiff = 0; |
839 | 831 | ||
840 | Type type = typeof(TRequest); | 832 | Type type = typeof(TRequest); |
@@ -876,27 +868,19 @@ namespace OpenSim.Framework | |||
876 | request.ContentLength = length; | 868 | request.ContentLength = length; |
877 | byte[] data = buffer.ToArray(); | 869 | byte[] data = buffer.ToArray(); |
878 | 870 | ||
879 | <<<<<<< HEAD | ||
880 | if (WebUtil.DebugLevel >= 5) | 871 | if (WebUtil.DebugLevel >= 5) |
881 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); | 872 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); |
882 | 873 | ||
883 | request.BeginGetRequestStream(delegate(IAsyncResult res) | 874 | request.BeginGetRequestStream(delegate(IAsyncResult res) |
884 | ======= | ||
885 | // capture how much time was spent writing | ||
886 | // useless in this async | ||
887 | // tickdata = Util.EnvironmentTickCountSubtract(tickstart); | ||
888 | request.BeginGetResponse(delegate(IAsyncResult ar) | ||
889 | >>>>>>> avn/ubitvar | ||
890 | { | 875 | { |
891 | using (Stream requestStream = request.EndGetRequestStream(res)) | 876 | using (Stream requestStream = request.EndGetRequestStream(res)) |
892 | requestStream.Write(data, 0, length); | 877 | requestStream.Write(data, 0, length); |
893 | 878 | ||
894 | // capture how much time was spent writing | 879 | // capture how much time was spent writing |
895 | tickdata = Util.EnvironmentTickCountSubtract(tickstart); | 880 | // tickdata = Util.EnvironmentTickCountSubtract(tickstart); |
896 | 881 | ||
897 | request.BeginGetResponse(delegate(IAsyncResult ar) | 882 | request.BeginGetResponse(delegate(IAsyncResult ar) |
898 | { | 883 | { |
899 | <<<<<<< HEAD | ||
900 | using (WebResponse response = request.EndGetResponse(ar)) | 884 | using (WebResponse response = request.EndGetResponse(ar)) |
901 | { | 885 | { |
902 | try | 886 | try |
@@ -911,14 +895,6 @@ namespace OpenSim.Framework | |||
911 | { | 895 | { |
912 | } | 896 | } |
913 | } | 897 | } |
914 | ======= | ||
915 | // Let's not close this | ||
916 | // yes do close it | ||
917 | buffer.Close(); | ||
918 | respStream.Close(); | ||
919 | response.Close(); | ||
920 | } | ||
921 | >>>>>>> avn/ubitvar | ||
922 | 898 | ||
923 | action(deserial); | 899 | action(deserial); |
924 | 900 | ||
@@ -980,7 +956,6 @@ namespace OpenSim.Framework | |||
980 | "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", | 956 | "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", |
981 | verb, requestUrl, e.Message, e.StackTrace); | 957 | verb, requestUrl, e.Message, e.StackTrace); |
982 | } | 958 | } |
983 | <<<<<<< HEAD | ||
984 | 959 | ||
985 | // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); | 960 | // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); |
986 | 961 | ||
@@ -998,83 +973,34 @@ namespace OpenSim.Framework | |||
998 | }, null); | 973 | }, null); |
999 | } | 974 | } |
1000 | 975 | ||
1001 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 976 | tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |
1002 | if (tickdiff > WebUtil.LongCallTime) | 977 | if (tickdiff > WebUtil.LongCallTime) |
1003 | { | 978 | { |
1004 | string originalRequest = null; | 979 | string originalRequest = null; |
1005 | 980 | ||
1006 | if (buffer != null) | 981 | if (buffer != null) |
1007 | ======= | ||
1008 | } | ||
1009 | catch (Exception e) | ||
1010 | { | ||
1011 | m_log.ErrorFormat( | ||
1012 | "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}", | ||
1013 | verb, requestUrl, e.Message, e.StackTrace); | ||
1014 | } | ||
1015 | |||
1016 | // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); | ||
1017 | try | ||
1018 | { | ||
1019 | action(deserial); | ||
1020 | } | ||
1021 | catch (Exception e) | ||
1022 | >>>>>>> avn/ubitvar | ||
1023 | { | 982 | { |
1024 | originalRequest = Encoding.UTF8.GetString(buffer.ToArray()); | 983 | originalRequest = Encoding.UTF8.GetString(buffer.ToArray()); |
1025 | 984 | ||
1026 | <<<<<<< HEAD | ||
1027 | if (originalRequest.Length > WebUtil.MaxRequestDiagLength) | 985 | if (originalRequest.Length > WebUtil.MaxRequestDiagLength) |
1028 | originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength); | 986 | originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength); |
1029 | } | 987 | } |
1030 | ======= | 988 | m_log.InfoFormat( |
1031 | tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | ||
1032 | if (tickdiff > WebUtil.LongCallTime) | ||
1033 | { | ||
1034 | /* | ||
1035 | string originalRequest = null; | ||
1036 | >>>>>>> avn/ubitvar | ||
1037 | |||
1038 | m_log.InfoFormat( | ||
1039 | "[LOGHTTP]: Slow AsynchronousRequestObject request {0} {1} to {2} took {3}ms, {4}ms writing, {5}", | 989 | "[LOGHTTP]: Slow AsynchronousRequestObject request {0} {1} to {2} took {3}ms, {4}ms writing, {5}", |
1040 | reqnum, verb, requestUrl, tickdiff, tickdata, | 990 | reqnum, verb, requestUrl, tickdiff, tickdata, |
1041 | originalRequest); | 991 | originalRequest); |
1042 | } | 992 | } |
1043 | else if (WebUtil.DebugLevel >= 4) | 993 | else if (WebUtil.DebugLevel >= 4) |
1044 | { | 994 | { |
1045 | m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} took {1}ms, {2}ms writing", | 995 | m_log.DebugFormat( |
1046 | reqnum, tickdiff, tickdata); | 996 | "[WEB UTIL]: HTTP OUT {0} took {1}ms", |
997 | reqnum, tickdiff); | ||
1047 | } | 998 | } |
1048 | <<<<<<< HEAD | ||
1049 | } | 999 | } |
1050 | finally | 1000 | finally |
1051 | { | 1001 | { |
1052 | if (buffer != null) | 1002 | if (buffer != null) |
1053 | buffer.Dispose(); | 1003 | buffer.Dispose(); |
1054 | ======= | ||
1055 | |||
1056 | m_log.InfoFormat( | ||
1057 | "[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", | ||
1058 | reqnum, | ||
1059 | verb, | ||
1060 | requestUrl, | ||
1061 | tickdiff, | ||
1062 | tickdata, | ||
1063 | originalRequest); | ||
1064 | */ | ||
1065 | m_log.InfoFormat( | ||
1066 | "[ASYNC REQUEST]: Slow WebRequest SETUP <{0}> {1} {2} took {3}ms", | ||
1067 | reqnum, | ||
1068 | verb, | ||
1069 | requestUrl, | ||
1070 | tickdiff); | ||
1071 | } | ||
1072 | else if (WebUtil.DebugLevel >= 4) | ||
1073 | { | ||
1074 | m_log.DebugFormat( | ||
1075 | "[WEB UTIL]: HTTP OUT {0} took {1}ms", | ||
1076 | reqnum, tickdiff); | ||
1077 | >>>>>>> avn/ubitvar | ||
1078 | } | 1004 | } |
1079 | } | 1005 | } |
1080 | } | 1006 | } |
@@ -1136,11 +1062,8 @@ namespace OpenSim.Framework | |||
1136 | request.ContentLength = length; | 1062 | request.ContentLength = length; |
1137 | byte[] data = buffer.ToArray(); | 1063 | byte[] data = buffer.ToArray(); |
1138 | 1064 | ||
1139 | <<<<<<< HEAD | ||
1140 | if (WebUtil.DebugLevel >= 5) | 1065 | if (WebUtil.DebugLevel >= 5) |
1141 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); | 1066 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); |
1142 | ======= | ||
1143 | >>>>>>> avn/ubitvar | ||
1144 | 1067 | ||
1145 | Stream requestStream = null; | 1068 | Stream requestStream = null; |
1146 | try | 1069 | try |
@@ -1188,10 +1111,6 @@ namespace OpenSim.Framework | |||
1188 | if (tickdiff > WebUtil.LongCallTime) | 1111 | if (tickdiff > WebUtil.LongCallTime) |
1189 | { | 1112 | { |
1190 | m_log.InfoFormat( | 1113 | m_log.InfoFormat( |
1191 | <<<<<<< HEAD | ||
1192 | "[LOGHTTP]: Slow SynchronousRestForms request {0} {1} to {2} took {3}ms, {4}ms writing, {5}", | ||
1193 | reqnum, verb, requestUrl, tickdiff, tickdata, | ||
1194 | ======= | ||
1195 | "[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", | 1114 | "[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}", |
1196 | reqnum, | 1115 | reqnum, |
1197 | verb, | 1116 | verb, |
@@ -1199,7 +1118,6 @@ namespace OpenSim.Framework | |||
1199 | tickdiff, | 1118 | tickdiff, |
1200 | tickset, | 1119 | tickset, |
1201 | tickdata, | 1120 | tickdata, |
1202 | >>>>>>> avn/ubitvar | ||
1203 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); | 1121 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); |
1204 | } | 1122 | } |
1205 | else if (WebUtil.DebugLevel >= 4) | 1123 | else if (WebUtil.DebugLevel >= 4) |
@@ -1336,8 +1254,6 @@ namespace OpenSim.Framework | |||
1336 | ht.ServicePoint.ConnectionLimit = maxConnections; | 1254 | ht.ServicePoint.ConnectionLimit = maxConnections; |
1337 | 1255 | ||
1338 | request.Method = verb; | 1256 | request.Method = verb; |
1339 | if (pTimeout != 0) | ||
1340 | request.Timeout = pTimeout * 1000; | ||
1341 | MemoryStream buffer = null; | 1257 | MemoryStream buffer = null; |
1342 | 1258 | ||
1343 | try | 1259 | try |
@@ -1351,29 +1267,17 @@ namespace OpenSim.Framework | |||
1351 | XmlWriterSettings settings = new XmlWriterSettings(); | 1267 | XmlWriterSettings settings = new XmlWriterSettings(); |
1352 | settings.Encoding = Encoding.UTF8; | 1268 | settings.Encoding = Encoding.UTF8; |
1353 | 1269 | ||
1354 | <<<<<<< HEAD | ||
1355 | using (XmlWriter writer = XmlWriter.Create(buffer, settings)) | 1270 | using (XmlWriter writer = XmlWriter.Create(buffer, settings)) |
1356 | { | 1271 | { |
1357 | XmlSerializer serializer = new XmlSerializer(type); | 1272 | XmlSerializer serializer = new XmlSerializer(type); |
1358 | serializer.Serialize(writer, obj); | 1273 | serializer.Serialize(writer, obj); |
1359 | writer.Flush(); | 1274 | writer.Flush(); |
1360 | } | 1275 | } |
1361 | ======= | ||
1362 | using (XmlWriter writer = XmlWriter.Create(buffer, settings)) | ||
1363 | { | ||
1364 | XmlSerializer serializer = new XmlSerializer(type); | ||
1365 | serializer.Serialize(writer, obj); | ||
1366 | writer.Flush(); | ||
1367 | if (WebUtil.DebugLevel >= 5) | ||
1368 | WebUtil.LogOutgoingDetail(buffer); | ||
1369 | } | ||
1370 | >>>>>>> avn/ubitvar | ||
1371 | 1276 | ||
1372 | int length = (int)buffer.Length; | 1277 | int length = (int)buffer.Length; |
1373 | request.ContentLength = length; | 1278 | request.ContentLength = length; |
1374 | byte[] data = buffer.ToArray(); | 1279 | byte[] data = buffer.ToArray(); |
1375 | 1280 | ||
1376 | <<<<<<< HEAD | ||
1377 | if (WebUtil.DebugLevel >= 5) | 1281 | if (WebUtil.DebugLevel >= 5) |
1378 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); | 1282 | WebUtil.LogOutgoingDetail("SEND", reqnum, System.Text.Encoding.UTF8.GetString(data)); |
1379 | 1283 | ||
@@ -1397,9 +1301,6 @@ namespace OpenSim.Framework | |||
1397 | } | 1301 | } |
1398 | } | 1302 | } |
1399 | 1303 | ||
1400 | ======= | ||
1401 | Stream requestStream = null; | ||
1402 | >>>>>>> avn/ubitvar | ||
1403 | try | 1304 | try |
1404 | { | 1305 | { |
1405 | using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) | 1306 | using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) |
@@ -1488,7 +1389,6 @@ namespace OpenSim.Framework | |||
1488 | 1389 | ||
1489 | return deserial; | 1390 | return deserial; |
1490 | } | 1391 | } |
1491 | |||
1492 | 1392 | ||
1493 | public static class XMLResponseHelper | 1393 | public static class XMLResponseHelper |
1494 | { | 1394 | { |