aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AssetBase.cs11
-rw-r--r--OpenSim/Framework/AvatarWearable.cs18
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs2
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs19
-rw-r--r--OpenSim/Framework/EstateSettings.cs23
-rw-r--r--OpenSim/Framework/IClientAPI.cs31
-rw-r--r--OpenSim/Framework/IMoneyModule.cs3
-rw-r--r--OpenSim/Framework/LandData.cs4
-rw-r--r--OpenSim/Framework/LocklessQueue.cs8
-rw-r--r--OpenSim/Framework/Monitoring/BaseStatsCollector.cs21
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs2
-rw-r--r--OpenSim/Framework/OSChatMessage.cs21
-rw-r--r--OpenSim/Framework/ObjectChangeData.cs80
-rw-r--r--OpenSim/Framework/ParcelMediaCommandEnum.cs2
-rw-r--r--OpenSim/Framework/PluginLoader.cs17
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs38
-rw-r--r--OpenSim/Framework/PriorityQueue.cs20
-rw-r--r--OpenSim/Framework/RegionInfo.cs30
-rw-r--r--OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs133
-rw-r--r--OpenSim/Framework/RegionSettings.cs24
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs14
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs87
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs4
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs145
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs4
-rw-r--r--OpenSim/Framework/Servers/Tests/OSHttpTests.cs4
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs6
-rw-r--r--OpenSim/Framework/TaskInventoryDictionary.cs189
-rw-r--r--OpenSim/Framework/TaskInventoryItem.cs2
-rw-r--r--OpenSim/Framework/Tests/MundaneFrameworkTests.cs6
-rw-r--r--OpenSim/Framework/ThrottleOutPacketType.cs2
-rw-r--r--OpenSim/Framework/UserProfiles.cs8
-rw-r--r--OpenSim/Framework/Util.cs46
-rw-r--r--OpenSim/Framework/WebUtil.cs33
34 files changed, 787 insertions, 270 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index d2c6c57..5da8e11 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -60,6 +60,8 @@ namespace OpenSim.Framework
60 /// </summary> 60 /// </summary>
61 private AssetMetadata m_metadata; 61 private AssetMetadata m_metadata;
62 62
63 private int m_uploadAttempts;
64
63 // This is needed for .NET serialization!!! 65 // This is needed for .NET serialization!!!
64 // Do NOT "Optimize" away! 66 // Do NOT "Optimize" away!
65 public AssetBase() 67 public AssetBase()
@@ -148,7 +150,8 @@ namespace OpenSim.Framework
148 Type == (sbyte)AssetType.SnapshotFolder || 150 Type == (sbyte)AssetType.SnapshotFolder ||
149 Type == (sbyte)AssetType.TrashFolder || 151 Type == (sbyte)AssetType.TrashFolder ||
150 Type == (sbyte)AssetType.ImageJPEG || 152 Type == (sbyte)AssetType.ImageJPEG ||
151 Type == (sbyte) AssetType.ImageTGA || 153 Type == (sbyte)AssetType.ImageTGA ||
154 Type == (sbyte)AssetType.Mesh ||
152 Type == (sbyte) AssetType.LSLBytecode); 155 Type == (sbyte) AssetType.LSLBytecode);
153 } 156 }
154 } 157 }
@@ -198,6 +201,12 @@ namespace OpenSim.Framework
198 set { m_metadata.Type = value; } 201 set { m_metadata.Type = value; }
199 } 202 }
200 203
204 public int UploadAttempts
205 {
206 get { return m_uploadAttempts; }
207 set { m_uploadAttempts = value; }
208 }
209
201 /// <summary> 210 /// <summary>
202 /// Is this a region only asset, or does this exist on the asset server also 211 /// Is this a region only asset, or does this exist on the asset server also
203 /// </summary> 212 /// </summary>
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 8e27596..aee295a 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -62,9 +62,14 @@ namespace OpenSim.Framework
62 public static readonly int UNDERSHIRT = 10; 62 public static readonly int UNDERSHIRT = 10;
63 public static readonly int UNDERPANTS = 11; 63 public static readonly int UNDERPANTS = 11;
64 public static readonly int SKIRT = 12; 64 public static readonly int SKIRT = 12;
65
66 public static readonly int MAX_BASICWEARABLES = 13;
67
65 public static readonly int ALPHA = 13; 68 public static readonly int ALPHA = 13;
66 public static readonly int TATTOO = 14; 69 public static readonly int TATTOO = 14;
70// public static readonly int PHYSICS = 15;
67 71
72 // public static readonly int MAX_WEARABLES = 16;
68 public static readonly int MAX_WEARABLES = 15; 73 public static readonly int MAX_WEARABLES = 15;
69 74
70 public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); 75 public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
@@ -219,7 +224,7 @@ namespace OpenSim.Framework
219 { 224 {
220 get 225 get
221 { 226 {
222 AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these 227 AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES];
223 for (int i = 0; i < MAX_WEARABLES; i++) 228 for (int i = 0; i < MAX_WEARABLES; i++)
224 { 229 {
225 defaultWearables[i] = new AvatarWearable(); 230 defaultWearables[i] = new AvatarWearable();
@@ -242,10 +247,13 @@ namespace OpenSim.Framework
242 247
243// // Alpha 248// // Alpha
244// defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET); 249// defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET);
245 250
246// // Tattoo 251 // // Tattoo
247// defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET); 252 // defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET);
248 253
254 // // Physics
255 // defaultWearables[PHYSICS].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET);
256
249 return defaultWearables; 257 return defaultWearables;
250 } 258 }
251 } 259 }
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs
index 97b3b60..42c0b18 100644
--- a/OpenSim/Framework/Communications/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient.cs
@@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications
363 _request = (HttpWebRequest) WebRequest.Create(buildUri()); 363 _request = (HttpWebRequest) WebRequest.Create(buildUri());
364 _request.KeepAlive = false; 364 _request.KeepAlive = false;
365 _request.ContentType = "application/xml"; 365 _request.ContentType = "application/xml";
366 _request.Timeout = 900000; 366 _request.Timeout = 30000;
367 _request.Method = RequestMethod; 367 _request.Method = RequestMethod;
368 _asyncException = null; 368 _asyncException = null;
369 _request.ContentLength = src.Length; 369 _request.ContentLength = src.Length;
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index b9f402a..9490013 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Console
83 = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n"; 83 = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n";
84 84
85 public const string ItemHelpText 85 public const string ItemHelpText
86= @"For more information, type 'help all' to get a list of all commands, 86= @"For more information, type 'help' to get a list of all commands,
87 or type help <item>' where <item> is one of the following:"; 87 or type help <item>' where <item> is one of the following:";
88 88
89 /// <value> 89 /// <value>
@@ -116,12 +116,14 @@ namespace OpenSim.Framework.Console
116 if (helpParts.Count == 0) 116 if (helpParts.Count == 0)
117 { 117 {
118 help.Add(GeneralHelpText); 118 help.Add(GeneralHelpText);
119 help.Add(ItemHelpText); 119 help.AddRange(CollectAllCommandsHelp());
120 help.AddRange(CollectModulesHelp(tree));
121 } 120 }
122 else if (helpParts.Count == 1 && helpParts[0] == "all") 121 else if (helpParts.Count == 1 && helpParts[0] == "categories")
123 { 122 {
124 help.AddRange(CollectAllCommandsHelp()); 123 help.Add(""); // Will become a newline.
124 help.Add(GeneralHelpText);
125 help.Add(ItemHelpText);
126 help.AddRange(CollectModulesHelp(tree));
125 } 127 }
126 else 128 else
127 { 129 {
@@ -145,8 +147,11 @@ namespace OpenSim.Framework.Console
145 { 147 {
146 foreach (List<CommandInfo> commands in m_modulesCommands.Values) 148 foreach (List<CommandInfo> commands in m_modulesCommands.Values)
147 { 149 {
148 var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help)); 150 foreach (CommandInfo c in commands)
149 help.AddRange(ourHelpText); 151 {
152 if (c.long_help != String.Empty)
153 help.Add(string.Format("{0} - {1}", c.help_text, c.long_help));
154 }
150 } 155 }
151 } 156 }
152 157
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index a02993d..5ddbd61 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -362,11 +362,30 @@ namespace OpenSim.Framework
362 return false; 362 return false;
363 } 363 }
364 364
365 public bool IsBanned(UUID avatarID) 365 public bool IsBanned(UUID avatarID, int userFlags)
366 { 366 {
367 foreach (EstateBan ban in l_EstateBans) 367 foreach (EstateBan ban in l_EstateBans)
368 if (ban.BannedUserID == avatarID) 368 if (ban.BannedUserID == avatarID)
369 return true; 369 return true;
370
371 if (!IsEstateManagerOrOwner(avatarID) && !HasAccess(avatarID))
372 {
373 if (DenyMinors)
374 {
375 if ((userFlags & 32) == 0)
376 {
377 return true;
378 }
379 }
380 if (DenyAnonymous)
381 {
382 if ((userFlags & 4) == 0)
383 {
384 return true;
385 }
386 }
387 }
388
370 return false; 389 return false;
371 } 390 }
372 391
@@ -374,7 +393,7 @@ namespace OpenSim.Framework
374 { 393 {
375 if (ban == null) 394 if (ban == null)
376 return; 395 return;
377 if (!IsBanned(ban.BannedUserID)) 396 if (!IsBanned(ban.BannedUserID, 32)) //Ignore age-based bans
378 l_EstateBans.Add(ban); 397 l_EstateBans.Add(ban);
379 } 398 }
380 399
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index e36edb2..22cc79d 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -64,14 +64,15 @@ namespace OpenSim.Framework
64 64
65 public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes); 65 public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes);
66 66
67 public delegate void CachedTextureRequest(IClientAPI remoteClient, int serial, List<CachedTextureRequestArg> cachedTextureRequest);
68
69 public delegate void SetAppearance(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 AvSize, WearableCacheItem[] CacheItems); 67 public delegate void SetAppearance(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 AvSize, WearableCacheItem[] CacheItems);
68 public delegate void CachedTextureRequest(IClientAPI remoteClient, int serial, List<CachedTextureRequestArg> cachedTextureRequest);
70 69
71 public delegate void StartAnim(IClientAPI remoteClient, UUID animID); 70 public delegate void StartAnim(IClientAPI remoteClient, UUID animID);
72 71
73 public delegate void StopAnim(IClientAPI remoteClient, UUID animID); 72 public delegate void StopAnim(IClientAPI remoteClient, UUID animID);
74 73
74 public delegate void ChangeAnim(UUID animID, bool addOrRemove, bool sendPack);
75
75 public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children); 76 public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children);
76 77
77 public delegate void DelinkObjects(List<uint> primIds, IClientAPI client); 78 public delegate void DelinkObjects(List<uint> primIds, IClientAPI client);
@@ -132,6 +133,8 @@ namespace OpenSim.Framework
132 133
133 public delegate void UpdateVector(uint localID, Vector3 pos, IClientAPI remoteClient); 134 public delegate void UpdateVector(uint localID, Vector3 pos, IClientAPI remoteClient);
134 135
136 public delegate void ClientChangeObject(uint localID, object data ,IClientAPI remoteClient);
137
135 public delegate void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient); 138 public delegate void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient);
136 139
137 public delegate void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient); 140 public delegate void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient);
@@ -268,6 +271,9 @@ namespace OpenSim.Framework
268 public delegate void MoveInventoryItem( 271 public delegate void MoveInventoryItem(
269 IClientAPI remoteClient, List<InventoryItemBase> items); 272 IClientAPI remoteClient, List<InventoryItemBase> items);
270 273
274 public delegate void MoveItemsAndLeaveCopy(
275 IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
276
271 public delegate void RemoveInventoryItem( 277 public delegate void RemoveInventoryItem(
272 IClientAPI remoteClient, List<UUID> itemIDs); 278 IClientAPI remoteClient, List<UUID> itemIDs);
273 279
@@ -443,6 +449,7 @@ namespace OpenSim.Framework
443 public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client); 449 public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client);
444 public delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client); 450 public delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client);
445 public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client); 451 public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client);
452 public delegate void ClassifiedGodDelete(UUID classifiedID, UUID queryID, IClientAPI client);
446 453
447 public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client); 454 public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client);
448 public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client); 455 public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client);
@@ -465,9 +472,9 @@ namespace OpenSim.Framework
465 472
466 public delegate void AgentFOV(IClientAPI client, float verticalAngle); 473 public delegate void AgentFOV(IClientAPI client, float verticalAngle);
467 474
468 public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID); 475 public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags);
469 476
470 public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID); 477 public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name);
471 478
472 public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); 479 public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages);
473 480
@@ -505,6 +512,7 @@ namespace OpenSim.Framework
505 public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID); 512 public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID);
506 513
507 public delegate void SendPostcard(IClientAPI client); 514 public delegate void SendPostcard(IClientAPI client);
515 public delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags);
508 516
509 #endregion 517 #endregion
510 518
@@ -794,6 +802,7 @@ namespace OpenSim.Framework
794 event ObjectDrop OnObjectDrop; 802 event ObjectDrop OnObjectDrop;
795 event StartAnim OnStartAnim; 803 event StartAnim OnStartAnim;
796 event StopAnim OnStopAnim; 804 event StopAnim OnStopAnim;
805 event ChangeAnim OnChangeAnim;
797 event LinkObjects OnLinkObjects; 806 event LinkObjects OnLinkObjects;
798 event DelinkObjects OnDelinkObjects; 807 event DelinkObjects OnDelinkObjects;
799 event RequestMapBlocks OnRequestMapBlocks; 808 event RequestMapBlocks OnRequestMapBlocks;
@@ -860,6 +869,7 @@ namespace OpenSim.Framework
860 event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; 869 event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
861 event UpdatePrimFlags OnUpdatePrimFlags; 870 event UpdatePrimFlags OnUpdatePrimFlags;
862 event UpdatePrimTexture OnUpdatePrimTexture; 871 event UpdatePrimTexture OnUpdatePrimTexture;
872 event ClientChangeObject onClientChangeObject;
863 event UpdateVector OnUpdatePrimGroupPosition; 873 event UpdateVector OnUpdatePrimGroupPosition;
864 event UpdateVector OnUpdatePrimSinglePosition; 874 event UpdateVector OnUpdatePrimSinglePosition;
865 event UpdatePrimRotation OnUpdatePrimGroupRotation; 875 event UpdatePrimRotation OnUpdatePrimGroupRotation;
@@ -884,6 +894,7 @@ namespace OpenSim.Framework
884 event RequestTaskInventory OnRequestTaskInventory; 894 event RequestTaskInventory OnRequestTaskInventory;
885 event UpdateInventoryItem OnUpdateInventoryItem; 895 event UpdateInventoryItem OnUpdateInventoryItem;
886 event CopyInventoryItem OnCopyInventoryItem; 896 event CopyInventoryItem OnCopyInventoryItem;
897 event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
887 event MoveInventoryItem OnMoveInventoryItem; 898 event MoveInventoryItem OnMoveInventoryItem;
888 event RemoveInventoryFolder OnRemoveInventoryFolder; 899 event RemoveInventoryFolder OnRemoveInventoryFolder;
889 event RemoveInventoryItem OnRemoveInventoryItem; 900 event RemoveInventoryItem OnRemoveInventoryItem;
@@ -1002,7 +1013,7 @@ namespace OpenSim.Framework
1002 event ClassifiedInfoRequest OnClassifiedInfoRequest; 1013 event ClassifiedInfoRequest OnClassifiedInfoRequest;
1003 event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 1014 event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
1004 event ClassifiedDelete OnClassifiedDelete; 1015 event ClassifiedDelete OnClassifiedDelete;
1005 event ClassifiedDelete OnClassifiedGodDelete; 1016 event ClassifiedGodDelete OnClassifiedGodDelete;
1006 1017
1007 event EventNotificationAddRequest OnEventNotificationAddRequest; 1018 event EventNotificationAddRequest OnEventNotificationAddRequest;
1008 event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 1019 event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
@@ -1041,11 +1052,12 @@ namespace OpenSim.Framework
1041 event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; 1052 event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
1042 event SimWideDeletesDelegate OnSimWideDeletes; 1053 event SimWideDeletesDelegate OnSimWideDeletes;
1043 event SendPostcard OnSendPostcard; 1054 event SendPostcard OnSendPostcard;
1055 event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
1044 event MuteListEntryUpdate OnUpdateMuteListEntry; 1056 event MuteListEntryUpdate OnUpdateMuteListEntry;
1045 event MuteListEntryRemove OnRemoveMuteListEntry; 1057 event MuteListEntryRemove OnRemoveMuteListEntry;
1046 event GodlikeMessage onGodlikeMessage; 1058 event GodlikeMessage onGodlikeMessage;
1047 event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 1059 event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
1048 1060 event GenericCall2 OnUpdateThrottles;
1049 /// <summary> 1061 /// <summary>
1050 /// Set the debug level at which packet output should be printed to console. 1062 /// Set the debug level at which packet output should be printed to console.
1051 /// </summary> 1063 /// </summary>
@@ -1066,7 +1078,7 @@ namespace OpenSim.Framework
1066 /// If true, attempts the close without checking active status. You do not want to try this except as a last 1078 /// If true, attempts the close without checking active status. You do not want to try this except as a last
1067 /// ditch attempt where Active == false but the ScenePresence still exists. 1079 /// ditch attempt where Active == false but the ScenePresence still exists.
1068 /// </param> 1080 /// </param>
1069 void Close(bool force); 1081 void Close(bool sendStop, bool force);
1070 1082
1071 void Kick(string message); 1083 void Kick(string message);
1072 1084
@@ -1169,6 +1181,8 @@ namespace OpenSim.Framework
1169 1181
1170 void SetChildAgentThrottle(byte[] throttle); 1182 void SetChildAgentThrottle(byte[] throttle);
1171 1183
1184 void SetAgentThrottleSilent(int throttle, int setting);
1185
1172 void SendAvatarDataImmediate(ISceneEntity avatar); 1186 void SendAvatarDataImmediate(ISceneEntity avatar);
1173 1187
1174 /// <summary> 1188 /// <summary>
@@ -1192,6 +1206,7 @@ namespace OpenSim.Framework
1192 /// </summary> 1206 /// </summary>
1193 /// <param name="Item"></param> 1207 /// <param name="Item"></param>
1194 void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId); 1208 void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId);
1209 void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId);
1195 1210
1196 void SendRemoveInventoryItem(UUID itemID); 1211 void SendRemoveInventoryItem(UUID itemID);
1197 1212
@@ -1211,7 +1226,7 @@ namespace OpenSim.Framework
1211 /// <param name="node"></param> 1226 /// <param name="node"></param>
1212 void SendBulkUpdateInventory(InventoryNodeBase node); 1227 void SendBulkUpdateInventory(InventoryNodeBase node);
1213 1228
1214 void SendXferPacket(ulong xferID, uint packet, byte[] data); 1229 void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory);
1215 1230
1216 void SendAbortXferPacket(ulong xferID); 1231 void SendAbortXferPacket(ulong xferID);
1217 1232
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs
index 52f3e83..55c9613 100644
--- a/OpenSim/Framework/IMoneyModule.cs
+++ b/OpenSim/Framework/IMoneyModule.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Framework
33 public interface IMoneyModule 33 public interface IMoneyModule
34 { 34 {
35 bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, 35 bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID,
36 int amount); 36 int amount, UUID txn, out string reason);
37 37
38 int GetBalance(UUID agentID); 38 int GetBalance(UUID agentID);
39 bool UploadCovered(UUID agentID, int amount); 39 bool UploadCovered(UUID agentID, int amount);
@@ -41,6 +41,7 @@ namespace OpenSim.Framework
41 void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type); 41 void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type);
42 void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData); 42 void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData);
43 void ApplyUploadCharge(UUID agentID, int amount, string text); 43 void ApplyUploadCharge(UUID agentID, int amount, string text);
44 void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
44 45
45 int UploadCharge { get; } 46 int UploadCharge { get; }
46 int GroupCreationCharge { get; } 47 int GroupCreationCharge { get; }
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index fc02f33..4dffd3f 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -67,9 +67,9 @@ namespace OpenSim.Framework
67 67
68 private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark | 68 private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
69 (uint)ParcelFlags.AllowAPrimitiveEntry | 69 (uint)ParcelFlags.AllowAPrimitiveEntry |
70 (uint)ParcelFlags.AllowDeedToGroup | (uint)ParcelFlags.AllowTerraform | 70 (uint)ParcelFlags.AllowDeedToGroup |
71 (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts | 71 (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
72 (uint)ParcelFlags.SoundLocal | (uint)ParcelFlags.AllowVoiceChat; 72 (uint)ParcelFlags.AllowVoiceChat;
73 73
74 private byte _landingType = 0; 74 private byte _landingType = 0;
75 private string _name = "Your Parcel"; 75 private string _name = "Your Parcel";
diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs
index 84f887c..9bd9baf 100644
--- a/OpenSim/Framework/LocklessQueue.cs
+++ b/OpenSim/Framework/LocklessQueue.cs
@@ -29,7 +29,7 @@ using System.Threading;
29 29
30namespace OpenSim.Framework 30namespace OpenSim.Framework
31{ 31{
32 public sealed class LocklessQueue<T> 32 public class LocklessQueue<T>
33 { 33 {
34 private sealed class SingleLinkNode 34 private sealed class SingleLinkNode
35 { 35 {
@@ -41,7 +41,7 @@ namespace OpenSim.Framework
41 SingleLinkNode tail; 41 SingleLinkNode tail;
42 int count; 42 int count;
43 43
44 public int Count { get { return count; } } 44 public virtual int Count { get { return count; } }
45 45
46 public LocklessQueue() 46 public LocklessQueue()
47 { 47 {
@@ -76,7 +76,7 @@ namespace OpenSim.Framework
76 Interlocked.Increment(ref count); 76 Interlocked.Increment(ref count);
77 } 77 }
78 78
79 public bool Dequeue(out T item) 79 public virtual bool Dequeue(out T item)
80 { 80 {
81 item = default(T); 81 item = default(T);
82 SingleLinkNode oldHead = null; 82 SingleLinkNode oldHead = null;
@@ -136,4 +136,4 @@ namespace OpenSim.Framework
136 (object)Interlocked.CompareExchange<SingleLinkNode>(ref location, newValue, comparand); 136 (object)Interlocked.CompareExchange<SingleLinkNode>(ref location, newValue, comparand);
137 } 137 }
138 } 138 }
139} \ No newline at end of file 139}
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
index 20495f6..96536e8 100644
--- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
@@ -43,7 +43,6 @@ namespace OpenSim.Framework.Monitoring
43 StringBuilder sb = new StringBuilder(Environment.NewLine); 43 StringBuilder sb = new StringBuilder(Environment.NewLine);
44 sb.Append("MEMORY STATISTICS"); 44 sb.Append("MEMORY STATISTICS");
45 sb.Append(Environment.NewLine); 45 sb.Append(Environment.NewLine);
46
47 sb.AppendFormat( 46 sb.AppendFormat(
48 "Heap allocated to OpenSim : {0} MB\n", 47 "Heap allocated to OpenSim : {0} MB\n",
49 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); 48 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
@@ -56,9 +55,23 @@ namespace OpenSim.Framework.Monitoring
56 "Average heap allocation rate: {0} MB/s\n", 55 "Average heap allocation rate: {0} MB/s\n",
57 Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3)); 56 Math.Round((MemoryWatchdog.AverageHeapAllocationRate * 1000) / 1024.0 / 1024, 3));
58 57
59 sb.AppendFormat( 58 Process myprocess = Process.GetCurrentProcess();
60 "Process memory : {0} MB\n", 59 if (!myprocess.HasExited)
61 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)); 60 {
61 myprocess.Refresh();
62 sb.AppendFormat(
63 "Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
64 Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0),
65 Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0),
66 Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0));
67 sb.AppendFormat(
68 "Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
69 Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0),
70 Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0),
71 Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0));
72 }
73 else
74 sb.Append("Process reported as Exited \n");
62 75
63 return sb.ToString(); 76 return sb.ToString();
64 } 77 }
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 45762a6..32724ec 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -386,4 +386,4 @@ namespace OpenSim.Framework.Monitoring
386 m_watchdogTimer.Start(); 386 m_watchdogTimer.Start();
387 } 387 }
388 } 388 }
389} \ No newline at end of file 389}
diff --git a/OpenSim/Framework/OSChatMessage.cs b/OpenSim/Framework/OSChatMessage.cs
index 455756d..7450be2 100644
--- a/OpenSim/Framework/OSChatMessage.cs
+++ b/OpenSim/Framework/OSChatMessage.cs
@@ -51,12 +51,11 @@ namespace OpenSim.Framework
51 protected object m_senderObject; 51 protected object m_senderObject;
52 protected ChatTypeEnum m_type; 52 protected ChatTypeEnum m_type;
53 protected UUID m_fromID; 53 protected UUID m_fromID;
54 protected UUID m_toID; 54 protected UUID m_destination = UUID.Zero;
55 55
56 public OSChatMessage() 56 public OSChatMessage()
57 { 57 {
58 m_position = new Vector3(); 58 m_position = new Vector3();
59 m_toID = UUID.Zero;
60 } 59 }
61 60
62 /// <summary> 61 /// <summary>
@@ -104,15 +103,6 @@ namespace OpenSim.Framework
104 set { m_from = value; } 103 set { m_from = value; }
105 } 104 }
106 105
107 /// <summary>
108 /// The name of the sender (needed for scripts)
109 /// </summary>
110 public string To
111 {
112 get { return m_from; }
113 set { m_from = value; }
114 }
115
116 #region IEventArgs Members 106 #region IEventArgs Members
117 107
118 /// TODO: Sender and SenderObject should just be Sender and of 108 /// TODO: Sender and SenderObject should just be Sender and of
@@ -142,13 +132,10 @@ namespace OpenSim.Framework
142 set { m_fromID = value; } 132 set { m_fromID = value; }
143 } 133 }
144 134
145 /// <summary> 135 public UUID Destination
146 /// The single recipient or all if not set.
147 /// </summary>
148 public UUID TargetUUID
149 { 136 {
150 get { return m_toID; } 137 get { return m_destination; }
151 set { m_toID = value; } 138 set { m_destination = value; }
152 } 139 }
153 140
154 /// <summary> 141 /// <summary>
diff --git a/OpenSim/Framework/ObjectChangeData.cs b/OpenSim/Framework/ObjectChangeData.cs
new file mode 100644
index 0000000..8d56291
--- /dev/null
+++ b/OpenSim/Framework/ObjectChangeData.cs
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29
30namespace OpenSim.Framework
31{
32 public enum ObjectChangeType : uint
33 {
34 // bits definitions
35 Position = 0x01,
36 Rotation = 0x02,
37 Scale = 0x04,
38 Group = 0x08,
39 UniformScale = 0x10,
40
41 // macros from above
42 // single prim
43 primP = 0x01,
44 primR = 0x02,
45 primPR = 0x03,
46 primS = 0x04,
47 primPS = 0x05,
48 primRS = 0x06,
49 primPSR = 0x07,
50
51 primUS = 0x14,
52 primPUS = 0x15,
53 primRUS = 0x16,
54 primPUSR = 0x17,
55
56 // group
57 groupP = 0x09,
58 groupR = 0x0A,
59 groupPR = 0x0B,
60 groupS = 0x0C,
61 groupPS = 0x0D,
62 groupRS = 0x0E,
63 groupPSR = 0x0F,
64
65 groupUS = 0x1C,
66 groupPUS = 0x1D,
67 groupRUS = 0x1E,
68 groupPUSR = 0x1F,
69
70 PRSmask = 0x07
71 }
72
73 public struct ObjectChangeData
74 {
75 public Quaternion rotation;
76 public Vector3 position;
77 public Vector3 scale;
78 public ObjectChangeType change;
79 }
80}
diff --git a/OpenSim/Framework/ParcelMediaCommandEnum.cs b/OpenSim/Framework/ParcelMediaCommandEnum.cs
index 93c41ec..e714382 100644
--- a/OpenSim/Framework/ParcelMediaCommandEnum.cs
+++ b/OpenSim/Framework/ParcelMediaCommandEnum.cs
@@ -27,7 +27,7 @@
27 27
28namespace OpenSim.Framework 28namespace OpenSim.Framework
29{ 29{
30 public enum ParcelMediaCommandEnum 30 public enum ParcelMediaCommandEnum : int
31 { 31 {
32 Stop = 0, 32 Stop = 0,
33 Pause = 1, 33 Pause = 1,
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs
index 819cb7b..cc80943 100644
--- a/OpenSim/Framework/PluginLoader.cs
+++ b/OpenSim/Framework/PluginLoader.cs
@@ -244,13 +244,22 @@ namespace OpenSim.Framework
244 // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) 244 // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
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
248 string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY");
249 string v0 = "addin-db-000";
250 string v1 = "addin-db-001";
251 if (customDir != null && customDir != String.Empty)
252 {
253 v0 = Path.Combine(customDir, v0);
254 v1 = Path.Combine(customDir, v1);
255 }
247 try 256 try
248 { 257 {
249 if (Directory.Exists("addin-db-000")) 258 if (Directory.Exists(v0))
250 Directory.Delete("addin-db-000", true); 259 Directory.Delete(v0, true);
251 260
252 if (Directory.Exists("addin-db-001")) 261 if (Directory.Exists(v1))
253 Directory.Delete("addin-db-001", true); 262 Directory.Delete(v1, true);
254 } 263 }
255 catch (IOException) 264 catch (IOException)
256 { 265 {
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index c8a5376..6a12a45 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -728,7 +728,12 @@ namespace OpenSim.Framework
728 return _lightColorR; 728 return _lightColorR;
729 } 729 }
730 set { 730 set {
731 _lightColorR = value; 731 if (value < 0)
732 _lightColorR = 0;
733 else if (value > 1.0f)
734 _lightColorR = 1.0f;
735 else
736 _lightColorR = value;
732 } 737 }
733 } 738 }
734 739
@@ -737,7 +742,12 @@ namespace OpenSim.Framework
737 return _lightColorG; 742 return _lightColorG;
738 } 743 }
739 set { 744 set {
740 _lightColorG = value; 745 if (value < 0)
746 _lightColorG = 0;
747 else if (value > 1.0f)
748 _lightColorG = 1.0f;
749 else
750 _lightColorG = value;
741 } 751 }
742 } 752 }
743 753
@@ -746,7 +756,12 @@ namespace OpenSim.Framework
746 return _lightColorB; 756 return _lightColorB;
747 } 757 }
748 set { 758 set {
749 _lightColorB = value; 759 if (value < 0)
760 _lightColorB = 0;
761 else if (value > 1.0f)
762 _lightColorB = 1.0f;
763 else
764 _lightColorB = value;
750 } 765 }
751 } 766 }
752 767
@@ -755,7 +770,12 @@ namespace OpenSim.Framework
755 return _lightColorA; 770 return _lightColorA;
756 } 771 }
757 set { 772 set {
758 _lightColorA = value; 773 if (value < 0)
774 _lightColorA = 0;
775 else if (value > 1.0f)
776 _lightColorA = 1.0f;
777 else
778 _lightColorA = value;
759 } 779 }
760 } 780 }
761 781
@@ -869,6 +889,11 @@ namespace OpenSim.Framework
869 889
870 public ulong GetMeshKey(Vector3 size, float lod) 890 public ulong GetMeshKey(Vector3 size, float lod)
871 { 891 {
892 return GetMeshKey(size, lod, false);
893 }
894
895 public ulong GetMeshKey(Vector3 size, float lod, bool convex)
896 {
872 ulong hash = 5381; 897 ulong hash = 5381;
873 898
874 hash = djb2(hash, this.PathCurve); 899 hash = djb2(hash, this.PathCurve);
@@ -914,6 +939,9 @@ namespace OpenSim.Framework
914 hash = djb2(hash, scaleBytes[i]); 939 hash = djb2(hash, scaleBytes[i]);
915 } 940 }
916 941
942 if(convex)
943 hash = djb2(hash, 0xa5);
944
917 return hash; 945 return hash;
918 } 946 }
919 947
@@ -1417,7 +1445,7 @@ namespace OpenSim.Framework
1417 prim.Textures = this.Textures; 1445 prim.Textures = this.Textures;
1418 1446
1419 prim.Properties = new Primitive.ObjectProperties(); 1447 prim.Properties = new Primitive.ObjectProperties();
1420 prim.Properties.Name = "Primitive"; 1448 prim.Properties.Name = "Object";
1421 prim.Properties.Description = ""; 1449 prim.Properties.Description = "";
1422 prim.Properties.CreatorID = UUID.Zero; 1450 prim.Properties.CreatorID = UUID.Zero;
1423 prim.Properties.GroupID = UUID.Zero; 1451 prim.Properties.GroupID = UUID.Zero;
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs
index e7a7f7f..e4f1111 100644
--- a/OpenSim/Framework/PriorityQueue.cs
+++ b/OpenSim/Framework/PriorityQueue.cs
@@ -45,7 +45,8 @@ namespace OpenSim.Framework
45 /// <summary> 45 /// <summary>
46 /// Total number of queues (priorities) available 46 /// Total number of queues (priorities) available
47 /// </summary> 47 /// </summary>
48 public const uint NumberOfQueues = 12; 48
49 public const uint NumberOfQueues = 12; // includes immediate queues, m_queueCounts need to be set acording
49 50
50 /// <summary> 51 /// <summary>
51 /// Number of queuest (priorities) that are processed immediately 52 /// Number of queuest (priorities) that are processed immediately
@@ -60,7 +61,8 @@ namespace OpenSim.Framework
60 // each pass. weighted towards the higher priority queues 61 // each pass. weighted towards the higher priority queues
61 private uint m_nextQueue = 0; 62 private uint m_nextQueue = 0;
62 private uint m_countFromQueue = 0; 63 private uint m_countFromQueue = 0;
63 private uint[] m_queueCounts = { 8, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1 }; 64 // first queues are imediate, so no counts
65 private uint[] m_queueCounts = {0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1};
64 66
65 // next request is a counter of the number of updates queued, it provides 67 // next request is a counter of the number of updates queued, it provides
66 // a total ordering on the updates coming through the queue and is more 68 // a total ordering on the updates coming through the queue and is more
@@ -137,7 +139,7 @@ namespace OpenSim.Framework
137 /// </summary> 139 /// </summary>
138 public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue) 140 public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue)
139 { 141 {
140 // If there is anything in priority queue 0, return it first no 142 // If there is anything in imediate queues, return it first no
141 // matter what else. Breaks fairness. But very useful. 143 // matter what else. Breaks fairness. But very useful.
142 for (int iq = 0; iq < NumberOfImmediateQueues; iq++) 144 for (int iq = 0; iq < NumberOfImmediateQueues; iq++)
143 { 145 {
@@ -172,14 +174,13 @@ namespace OpenSim.Framework
172 } 174 }
173 175
174 // Find the next non-immediate queue with updates in it 176 // Find the next non-immediate queue with updates in it
175 for (int i = 0; i < NumberOfQueues; ++i) 177 for (uint i = NumberOfImmediateQueues; i < NumberOfQueues; ++i)
176 { 178 {
177 m_nextQueue = (uint)((m_nextQueue + 1) % NumberOfQueues); 179 m_nextQueue++;
178 m_countFromQueue = m_queueCounts[m_nextQueue]; 180 if(m_nextQueue >= NumberOfQueues)
181 m_nextQueue = NumberOfImmediateQueues;
179 182
180 // if this is one of the immediate queues, just skip it 183 m_countFromQueue = m_queueCounts[m_nextQueue];
181 if (m_nextQueue < NumberOfImmediateQueues)
182 continue;
183 184
184 if (m_heaps[m_nextQueue].Count > 0) 185 if (m_heaps[m_nextQueue].Count > 0)
185 { 186 {
@@ -189,7 +190,6 @@ namespace OpenSim.Framework
189 m_lookupTable.Remove(item.Value.Entity.LocalId); 190 m_lookupTable.Remove(item.Value.Entity.LocalId);
190 timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); 191 timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime);
191 value = item.Value; 192 value = item.Value;
192
193 return true; 193 return true;
194 } 194 }
195 } 195 }
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 1de30af..b9e84ac 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -40,6 +40,7 @@ using OpenMetaverse.StructuredData;
40 40
41namespace OpenSim.Framework 41namespace OpenSim.Framework
42{ 42{
43 [Serializable]
43 public class RegionLightShareData : ICloneable 44 public class RegionLightShareData : ICloneable
44 { 45 {
45 public bool valid = false; 46 public bool valid = false;
@@ -103,6 +104,7 @@ namespace OpenSim.Framework
103 104
104 public bool commFailTF = false; 105 public bool commFailTF = false;
105 public ConfigurationMember configMember; 106 public ConfigurationMember configMember;
107 public string DataStore = String.Empty;
106 public string RegionFile = String.Empty; 108 public string RegionFile = String.Empty;
107 public bool isSandbox = false; 109 public bool isSandbox = false;
108 public bool Persistent = true; 110 public bool Persistent = true;
@@ -798,6 +800,8 @@ namespace OpenSim.Framework
798 string location = String.Format("{0},{1}", RegionLocX, RegionLocY); 800 string location = String.Format("{0},{1}", RegionLocX, RegionLocY);
799 config.Set("Location", location); 801 config.Set("Location", location);
800 802
803 if (DataStore != String.Empty)
804 config.Set("Datastore", DataStore);
801 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize) 805 if (RegionSizeX != Constants.RegionSize || RegionSizeY != Constants.RegionSize)
802 { 806 {
803 config.Set("SizeX", RegionSizeX); 807 config.Set("SizeX", RegionSizeX);
@@ -1044,6 +1048,9 @@ namespace OpenSim.Framework
1044 case "sim_size_z": 1048 case "sim_size_z":
1045 RegionSizeZ = (uint) configuration_result; 1049 RegionSizeZ = (uint) configuration_result;
1046 break; 1050 break;
1051 case "datastore":
1052 DataStore = (string) configuration_result;
1053 break;
1047 case "internal_ip_address": 1054 case "internal_ip_address":
1048 IPAddress address = (IPAddress) configuration_result; 1055 IPAddress address = (IPAddress) configuration_result;
1049 m_internalEndPoint = new IPEndPoint(address, 0); 1056 m_internalEndPoint = new IPEndPoint(address, 0);
@@ -1211,5 +1218,28 @@ namespace OpenSim.Framework
1211 regionInfo.ServerURI = serverURI; 1218 regionInfo.ServerURI = serverURI;
1212 return regionInfo; 1219 return regionInfo;
1213 } 1220 }
1221
1222 public int getInternalEndPointPort()
1223 {
1224 return m_internalEndPoint.Port;
1225 }
1226
1227 public Dictionary<string, object> ToKeyValuePairs()
1228 {
1229 Dictionary<string, object> kvp = new Dictionary<string, object>();
1230 kvp["uuid"] = RegionID.ToString();
1231 kvp["locX"] = RegionLocX.ToString();
1232 kvp["locY"] = RegionLocY.ToString();
1233 kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
1234 kvp["external_port"] = ExternalEndPoint.Port.ToString();
1235 kvp["external_host_name"] = ExternalHostName;
1236 kvp["http_port"] = HttpPort.ToString();
1237 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
1238 kvp["internal_port"] = InternalEndPoint.Port.ToString();
1239 kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
1240 kvp["server_uri"] = ServerURI;
1241
1242 return kvp;
1243 }
1214 } 1244 }
1215} 1245}
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
index 05c64fa..c7caf6f 100644
--- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
+++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
@@ -48,6 +48,9 @@ namespace OpenSim.Framework.RegionLoader.Web
48 48
49 public RegionInfo[] LoadRegions() 49 public RegionInfo[] LoadRegions()
50 { 50 {
51 int tries = 3;
52 int wait = 2000;
53
51 if (m_configSource == null) 54 if (m_configSource == null)
52 { 55 {
53 m_log.Error("[WEBLOADER]: Unable to load configuration source!"); 56 m_log.Error("[WEBLOADER]: Unable to load configuration source!");
@@ -66,82 +69,74 @@ namespace OpenSim.Framework.RegionLoader.Web
66 } 69 }
67 else 70 else
68 { 71 {
69 RegionInfo[] regionInfos = new RegionInfo[] {}; 72 while(tries > 0)
70 int regionCount = 0; 73 {
71 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); 74 RegionInfo[] regionInfos = new RegionInfo[] {};
72 webRequest.Timeout = 30000; //30 Second Timeout 75 int regionCount = 0;
73 m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); 76 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
74 77 webRequest.Timeout = 30000; //30 Second Timeout
75 try 78 m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
76 {
77 string xmlSource = String.Empty;
78 79
79 using (HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse()) 80 try
80 { 81 {
81 m_log.Debug("[WEBLOADER]: Downloading region information..."); 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 == "Regions")
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 }
82 123
83 using (Stream s = webResponse.GetResponseStream()) 124 if (regionCount > 0 | allowRegionless)
84 { 125 return regionInfos;
85 using (StreamReader reader = new StreamReader(s))
86 {
87 string tempStr = reader.ReadLine();
88 while (tempStr != null)
89 {
90 xmlSource = xmlSource + tempStr;
91 tempStr = reader.ReadLine();
92 }
93 }
94 }
95 }
96 126
97 m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + 127 m_log.Debug("[WEBLOADER]: Request yielded no regions.");
98 xmlSource.Length); 128 tries--;
99 XmlDocument xmlDoc = new XmlDocument(); 129 if (tries > 0)
100 xmlDoc.LoadXml(xmlSource);
101 if (xmlDoc.FirstChild.Name == "Regions")
102 {
103 regionCount = xmlDoc.FirstChild.ChildNodes.Count;
104
105 if (regionCount > 0)
106 {
107 regionInfos = new RegionInfo[regionCount];
108 int i;
109 for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
110 {
111 m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
112 regionInfos[i] =
113 new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
114 }
115 }
116 }
117 }
118 catch (WebException ex)
119 {
120 using (HttpWebResponse response = (HttpWebResponse)ex.Response)
121 { 130 {
122 if (response.StatusCode == HttpStatusCode.NotFound) 131 m_log.Debug("[WEBLOADER]: Retrying");
123 { 132 System.Threading.Thread.Sleep(wait);
124 if (!allowRegionless)
125 throw ex;
126 }
127 else
128 {
129 throw ex;
130 }
131 } 133 }
132 } 134 }
133 135
134 if (regionCount > 0 | allowRegionless) 136 m_log.Error("[WEBLOADER]: No region configs were available.");
135 { 137 return null;
136 return regionInfos;
137 }
138 else
139 {
140 m_log.Error("[WEBLOADER]: No region configs were available.");
141 return null;
142 }
143 } 138 }
144 } 139 }
145 } 140 }
146 } 141 }
147} \ No newline at end of file 142}
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs
index a895c40..dec01ea 100644
--- a/OpenSim/Framework/RegionSettings.cs
+++ b/OpenSim/Framework/RegionSettings.cs
@@ -482,6 +482,28 @@ namespace OpenSim.Framework
482 set { m_LoadedCreationID = value; } 482 set { m_LoadedCreationID = value; }
483 } 483 }
484 484
485 private bool m_GodBlockSearch = false;
486 public bool GodBlockSearch
487 {
488 get { return m_GodBlockSearch; }
489 set { m_GodBlockSearch = value; }
490 }
491
492 private bool m_Casino = false;
493 public bool Casino
494 {
495 get { return m_Casino; }
496 set { m_Casino = value; }
497 }
498
499 // Telehub support
500 private bool m_TelehubEnabled = false;
501 public bool HasTelehub
502 {
503 get { return m_TelehubEnabled; }
504 set { m_TelehubEnabled = value; }
505 }
506
485 /// <summary> 507 /// <summary>
486 /// Connected Telehub object 508 /// Connected Telehub object
487 /// </summary> 509 /// </summary>
@@ -520,4 +542,4 @@ namespace OpenSim.Framework
520 l_SpawnPoints.Clear(); 542 l_SpawnPoints.Clear();
521 } 543 }
522 } 544 }
523} \ No newline at end of file 545}
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 566772d..cbd34a2 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -130,7 +130,17 @@ namespace OpenSim.Framework.Servers
130 /// Performs initialisation of the scene, such as loading configuration from disk. 130 /// Performs initialisation of the scene, such as loading configuration from disk.
131 /// </summary> 131 /// </summary>
132 public virtual void Startup() 132 public virtual void Startup()
133 { 133 {
134 m_log.Info("[STARTUP]: Beginning startup processing");
135
136 m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine);
137 // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
138 // the clr version number doesn't match the project version number under Mono.
139 //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
140 m_log.InfoFormat(
141 "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
142 Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
143
134 StartupSpecific(); 144 StartupSpecific();
135 145
136 TimeSpan timeTaken = DateTime.Now - m_startuptime; 146 TimeSpan timeTaken = DateTime.Now - m_startuptime;
@@ -159,4 +169,4 @@ namespace OpenSim.Framework.Servers
159 } 169 }
160 } 170 }
161 } 171 }
162} \ No newline at end of file 172}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index e1ae74e..7841f47 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -401,6 +401,7 @@ namespace OpenSim.Framework.Servers.HttpServer
401 StreamReader reader = new StreamReader(requestStream, encoding); 401 StreamReader reader = new StreamReader(requestStream, encoding);
402 402
403 string requestBody = reader.ReadToEnd(); 403 string requestBody = reader.ReadToEnd();
404 reader.Close();
404 405
405 Hashtable keysvals = new Hashtable(); 406 Hashtable keysvals = new Hashtable();
406 Hashtable headervals = new Hashtable(); 407 Hashtable headervals = new Hashtable();
@@ -740,7 +741,7 @@ namespace OpenSim.Framework.Servers.HttpServer
740 // Every month or so this will wrap and give bad numbers, not really a problem 741 // Every month or so this will wrap and give bad numbers, not really a problem
741 // since its just for reporting 742 // since its just for reporting
742 int tickdiff = requestEndTick - requestStartTick; 743 int tickdiff = requestEndTick - requestStartTick;
743 if (tickdiff > 3000 && requestHandler != null && requestHandler.Name != "GetTexture") 744 if (tickdiff > 3000 && (requestHandler == null || requestHandler.Name == null || requestHandler.Name != "GetTexture"))
744 { 745 {
745 m_log.InfoFormat( 746 m_log.InfoFormat(
746 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", 747 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
@@ -1675,10 +1676,40 @@ namespace OpenSim.Framework.Servers.HttpServer
1675 1676
1676 internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) 1677 internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response)
1677 { 1678 {
1678 //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); 1679 int responsecode;
1679 int responsecode = (int)responsedata["int_response_code"]; 1680 string responseString = String.Empty;
1680 string responseString = (string)responsedata["str_response_string"]; 1681 byte[] responseData = null;
1681 string contentType = (string)responsedata["content_type"]; 1682 string contentType;
1683
1684 if (responsedata == null)
1685 {
1686 responsecode = 500;
1687 responseString = "No response could be obtained";
1688 contentType = "text/plain";
1689 responsedata = new Hashtable();
1690 }
1691 else
1692 {
1693 try
1694 {
1695 //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
1696 responsecode = (int)responsedata["int_response_code"];
1697 if (responsedata["bin_response_data"] != null)
1698 responseData = (byte[])responsedata["bin_response_data"];
1699 else
1700 responseString = (string)responsedata["str_response_string"];
1701 contentType = (string)responsedata["content_type"];
1702 if (responseString == null)
1703 responseString = String.Empty;
1704 }
1705 catch
1706 {
1707 responsecode = 500;
1708 responseString = "No response could be obtained";
1709 contentType = "text/plain";
1710 responsedata = new Hashtable();
1711 }
1712 }
1682 1713
1683 if (responsedata.ContainsKey("error_status_text")) 1714 if (responsedata.ContainsKey("error_status_text"))
1684 { 1715 {
@@ -1723,25 +1754,40 @@ namespace OpenSim.Framework.Servers.HttpServer
1723 1754
1724 response.AddHeader("Content-Type", contentType); 1755 response.AddHeader("Content-Type", contentType);
1725 1756
1757 if (responsedata.ContainsKey("headers"))
1758 {
1759 Hashtable headerdata = (Hashtable)responsedata["headers"];
1760
1761 foreach (string header in headerdata.Keys)
1762 response.AddHeader(header, (string)headerdata[header]);
1763 }
1764
1726 byte[] buffer; 1765 byte[] buffer;
1727 1766
1728 if (!(contentType.Contains("image") 1767 if (responseData != null)
1729 || contentType.Contains("x-shockwave-flash")
1730 || contentType.Contains("application/x-oar")
1731 || contentType.Contains("application/vnd.ll.mesh")))
1732 { 1768 {
1733 // Text 1769 buffer = responseData;
1734 buffer = Encoding.UTF8.GetBytes(responseString);
1735 } 1770 }
1736 else 1771 else
1737 { 1772 {
1738 // Binary! 1773 if (!(contentType.Contains("image")
1739 buffer = Convert.FromBase64String(responseString); 1774 || contentType.Contains("x-shockwave-flash")
1740 } 1775 || contentType.Contains("application/x-oar")
1776 || contentType.Contains("application/vnd.ll.mesh")))
1777 {
1778 // Text
1779 buffer = Encoding.UTF8.GetBytes(responseString);
1780 }
1781 else
1782 {
1783 // Binary!
1784 buffer = Convert.FromBase64String(responseString);
1785 }
1741 1786
1742 response.SendChunked = false; 1787 response.SendChunked = false;
1743 response.ContentLength64 = buffer.Length; 1788 response.ContentLength64 = buffer.Length;
1744 response.ContentEncoding = Encoding.UTF8; 1789 response.ContentEncoding = Encoding.UTF8;
1790 }
1745 1791
1746 return buffer; 1792 return buffer;
1747 } 1793 }
@@ -1822,7 +1868,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1822 m_httpListener2.Start(64); 1868 m_httpListener2.Start(64);
1823 1869
1824 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events 1870 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
1825 m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); 1871 m_PollServiceManager = new PollServiceRequestManager(this, 4, 25000);
1826 m_PollServiceManager.Start(); 1872 m_PollServiceManager.Start();
1827 HTTPDRunning = true; 1873 HTTPDRunning = true;
1828 1874
@@ -1872,7 +1918,9 @@ namespace OpenSim.Framework.Servers.HttpServer
1872 1918
1873 public void httpServerException(object source, Exception exception) 1919 public void httpServerException(object source, Exception exception)
1874 { 1920 {
1875 m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception); 1921 if (source.ToString() == "HttpServer.HttpListener" && exception.ToString().StartsWith("Mono.Security.Protocol.Tls.TlsException"))
1922 return;
1923 m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
1876 /* 1924 /*
1877 if (HTTPDRunning)// && NotSocketErrors > 5) 1925 if (HTTPDRunning)// && NotSocketErrors > 5)
1878 { 1926 {
@@ -1919,6 +1967,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1919 1967
1920 public void RemoveHTTPHandler(string httpMethod, string path) 1968 public void RemoveHTTPHandler(string httpMethod, string path)
1921 { 1969 {
1970 if (path == null) return; // Caps module isn't loaded, tries to remove handler where path = null
1922 lock (m_HTTPHandlers) 1971 lock (m_HTTPHandlers)
1923 { 1972 {
1924 if (httpMethod != null && httpMethod.Length == 0) 1973 if (httpMethod != null && httpMethod.Length == 0)
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index 9477100..3fd3bf7 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -52,7 +52,9 @@ namespace OpenSim.Framework.Servers.HttpServer
52 { 52 {
53 LongPoll = 0, 53 LongPoll = 0,
54 LslHttp = 1, 54 LslHttp = 1,
55 Inventory = 2 55 Inventory = 2,
56 Texture = 3,
57 Mesh = 4
56 } 58 }
57 59
58 public string Url { get; set; } 60 public string Url { get; set; }
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 6aa5907..44f7045 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -47,17 +47,18 @@ namespace OpenSim.Framework.Servers.HttpServer
47 private readonly BaseHttpServer m_server; 47 private readonly BaseHttpServer m_server;
48 48
49 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); 49 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>();
50 private static List<PollServiceHttpRequest> m_longPollRequests = new List<PollServiceHttpRequest>(); 50 private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>();
51 private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>();
51 52
52 private uint m_WorkerThreadCount = 0; 53 private uint m_WorkerThreadCount = 0;
53 private Thread[] m_workerThreads; 54 private Thread[] m_workerThreads;
55 private Thread m_retrysThread;
54 56
55 private bool m_running = true; 57 private bool m_running = true;
58 private int slowCount = 0;
56 59
57 private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); 60 private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2);
58 61
59// private int m_timeout = 1000; // increase timeout 250; now use the event one
60
61 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) 62 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
62 { 63 {
63 m_server = pSrv; 64 m_server = pSrv;
@@ -81,9 +82,9 @@ namespace OpenSim.Framework.Servers.HttpServer
81 int.MaxValue); 82 int.MaxValue);
82 } 83 }
83 84
84 Watchdog.StartThread( 85 m_retrysThread = Watchdog.StartThread(
85 this.CheckLongPollThreads, 86 this.CheckRetries,
86 string.Format("LongPollServiceWatcherThread:{0}", m_server.Port), 87 string.Format("PollServiceWatcherThread:{0}", m_server.Port),
87 ThreadPriority.Normal, 88 ThreadPriority.Normal,
88 false, 89 false,
89 true, 90 true,
@@ -95,15 +96,8 @@ namespace OpenSim.Framework.Servers.HttpServer
95 { 96 {
96 if (m_running) 97 if (m_running)
97 { 98 {
98 // delay the enqueueing for 100ms. There's no need to have the event 99 lock (m_retryRequests)
99 // actively on the queue 100 m_retryRequests.Enqueue(req);
100 Timer t = new Timer(self => {
101 ((Timer)self).Dispose();
102 m_requests.Enqueue(req);
103 });
104
105 t.Change(100, Timeout.Infinite);
106
107 } 101 }
108 } 102 }
109 103
@@ -111,47 +105,39 @@ namespace OpenSim.Framework.Servers.HttpServer
111 { 105 {
112 if (m_running) 106 if (m_running)
113 { 107 {
114 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) 108 if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll)
115 { 109 {
116 lock (m_longPollRequests) 110 m_requests.Enqueue(req);
117 m_longPollRequests.Add(req);
118 } 111 }
119 else 112 else
120 m_requests.Enqueue(req); 113 {
114 lock (m_slowRequests)
115 m_slowRequests.Enqueue(req);
116 }
121 } 117 }
122 } 118 }
123 119
124 private void CheckLongPollThreads() 120 private void CheckRetries()
125 { 121 {
126 // The only purpose of this thread is to check the EQs for events.
127 // If there are events, that thread will be placed in the "ready-to-serve" queue, m_requests.
128 // If there are no events, that thread will be back to its "waiting" queue, m_longPollRequests.
129 // All other types of tasks (Inventory handlers, http-in, etc) don't have the long-poll nature,
130 // so if they aren't ready to be served by a worker thread (no events), they are placed
131 // directly back in the "ready-to-serve" queue by the worker thread.
132 while (m_running) 122 while (m_running)
133 { 123 {
134 Thread.Sleep(500); 124 Thread.Sleep(100); // let the world move .. back to faster rate
135 Watchdog.UpdateThread(); 125 Watchdog.UpdateThread();
136 126 lock (m_retryRequests)
137// List<PollServiceHttpRequest> not_ready = new List<PollServiceHttpRequest>();
138 lock (m_longPollRequests)
139 { 127 {
140 if (m_longPollRequests.Count > 0 && m_running) 128 while (m_retryRequests.Count > 0 && m_running)
141 { 129 m_requests.Enqueue(m_retryRequests.Dequeue());
142 List<PollServiceHttpRequest> ready = m_longPollRequests.FindAll(req => 130 }
143 (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ 131 slowCount++;
144 (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout 132 if (slowCount >= 10)
145 ); 133 {
146 134 slowCount = 0;
147 ready.ForEach(req =>
148 {
149 m_requests.Enqueue(req);
150 m_longPollRequests.Remove(req);
151 });
152 135
136 lock (m_slowRequests)
137 {
138 while (m_slowRequests.Count > 0 && m_running)
139 m_requests.Enqueue(m_slowRequests.Dequeue());
153 } 140 }
154
155 } 141 }
156 } 142 }
157 } 143 }
@@ -159,18 +145,30 @@ namespace OpenSim.Framework.Servers.HttpServer
159 public void Stop() 145 public void Stop()
160 { 146 {
161 m_running = false; 147 m_running = false;
162// m_timeout = -10000; // cause all to expire
163 Thread.Sleep(1000); // let the world move 148 Thread.Sleep(1000); // let the world move
164 149
165 foreach (Thread t in m_workerThreads) 150 foreach (Thread t in m_workerThreads)
166 Watchdog.AbortThread(t.ManagedThreadId); 151 Watchdog.AbortThread(t.ManagedThreadId);
167 152
153 try
154 {
155 foreach (PollServiceHttpRequest req in m_retryRequests)
156 {
157 DoHTTPGruntWork(m_server,req,
158 req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
159 }
160 }
161 catch
162 {
163 }
164
168 PollServiceHttpRequest wreq; 165 PollServiceHttpRequest wreq;
166 m_retryRequests.Clear();
169 167
170 lock (m_longPollRequests) 168 lock (m_slowRequests)
171 { 169 {
172 if (m_longPollRequests.Count > 0 && m_running) 170 while (m_slowRequests.Count > 0 && m_running)
173 m_longPollRequests.ForEach(req => m_requests.Enqueue(req)); 171 m_requests.Enqueue(m_slowRequests.Dequeue());
174 } 172 }
175 173
176 while (m_requests.Count() > 0) 174 while (m_requests.Count() > 0)
@@ -178,15 +176,14 @@ namespace OpenSim.Framework.Servers.HttpServer
178 try 176 try
179 { 177 {
180 wreq = m_requests.Dequeue(0); 178 wreq = m_requests.Dequeue(0);
181 wreq.DoHTTPGruntWork( 179 DoHTTPGruntWork(m_server,wreq,
182 m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); 180 wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id));
183 } 181 }
184 catch 182 catch
185 { 183 {
186 } 184 }
187 } 185 }
188 186
189 m_longPollRequests.Clear();
190 m_requests.Clear(); 187 m_requests.Clear();
191 } 188 }
192 189
@@ -197,7 +194,6 @@ namespace OpenSim.Framework.Servers.HttpServer
197 while (m_running) 194 while (m_running)
198 { 195 {
199 PollServiceHttpRequest req = m_requests.Dequeue(5000); 196 PollServiceHttpRequest req = m_requests.Dequeue(5000);
200 //m_log.WarnFormat("[YYY]: Dequeued {0}", (req == null ? "null" : req.PollServiceArgs.Type.ToString()));
201 197
202 Watchdog.UpdateThread(); 198 Watchdog.UpdateThread();
203 if (req != null) 199 if (req != null)
@@ -215,7 +211,7 @@ namespace OpenSim.Framework.Servers.HttpServer
215 { 211 {
216 try 212 try
217 { 213 {
218 req.DoHTTPGruntWork(m_server, responsedata); 214 DoHTTPGruntWork(m_server, req, responsedata);
219 } 215 }
220 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 216 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
221 { 217 {
@@ -228,7 +224,7 @@ namespace OpenSim.Framework.Servers.HttpServer
228 { 224 {
229 try 225 try
230 { 226 {
231 req.DoHTTPGruntWork(m_server, responsedata); 227 DoHTTPGruntWork(m_server, req, responsedata);
232 } 228 }
233 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 229 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
234 { 230 {
@@ -243,8 +239,8 @@ namespace OpenSim.Framework.Servers.HttpServer
243 { 239 {
244 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) 240 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
245 { 241 {
246 req.DoHTTPGruntWork( 242 DoHTTPGruntWork(m_server, req,
247 m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); 243 req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
248 } 244 }
249 else 245 else
250 { 246 {
@@ -259,5 +255,42 @@ namespace OpenSim.Framework.Servers.HttpServer
259 } 255 }
260 } 256 }
261 } 257 }
258
259 // DoHTTPGruntWork changed, not sending response
260 // do the same work around as core
261
262 internal static void DoHTTPGruntWork(BaseHttpServer server, PollServiceHttpRequest req, Hashtable responsedata)
263 {
264 OSHttpResponse response
265 = new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext);
266
267 byte[] buffer = server.DoHTTPGruntWork(responsedata, response);
268
269 response.SendChunked = false;
270 response.ContentLength64 = buffer.Length;
271 response.ContentEncoding = Encoding.UTF8;
272
273 try
274 {
275 response.OutputStream.Write(buffer, 0, buffer.Length);
276 }
277 catch (Exception ex)
278 {
279 m_log.Warn(string.Format("[POLL SERVICE WORKER THREAD]: Error ", ex));
280 }
281 finally
282 {
283 try
284 {
285 response.OutputStream.Flush();
286 response.Send();
287 }
288 catch (Exception e)
289 {
290 m_log.Warn(String.Format("[POLL SERVICE WORKER THREAD]: Error ", e));
291 }
292 }
293 }
262 } 294 }
263} \ No newline at end of file 295}
296
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index c258ff6..7108314 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -769,7 +769,7 @@ namespace OpenSim.Framework.Servers
769 } 769 }
770 } 770 }
771 771
772 protected string GetVersionText() 772 public string GetVersionText()
773 { 773 {
774 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion); 774 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion);
775 } 775 }
@@ -942,4 +942,4 @@ namespace OpenSim.Framework.Servers
942 /// </summary> 942 /// </summary>
943 protected virtual void ShutdownSpecific() {} 943 protected virtual void ShutdownSpecific() {}
944 } 944 }
945} \ No newline at end of file 945}
diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
index 5b912b4..deae45c 100644
--- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
+++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
@@ -81,6 +81,10 @@ namespace OpenSim.Framework.Servers.Tests
81 /// </summary> 81 /// </summary>
82 public event EventHandler<RequestEventArgs> RequestReceived = delegate { }; 82 public event EventHandler<RequestEventArgs> RequestReceived = delegate { };
83 83
84 public bool CanSend { get { return true; } }
85 public string RemoteEndPoint { get { return ""; } }
86 public string RemoteEndPointAddress { get { return ""; } }
87 public string RemoteEndPointPort { get { return ""; } }
84 } 88 }
85 89
86 public class TestHttpRequest: IHttpRequest 90 public class TestHttpRequest: IHttpRequest
diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs
index 98c19b9..33b1366 100644
--- a/OpenSim/Framework/Servers/VersionInfo.cs
+++ b/OpenSim/Framework/Servers/VersionInfo.cs
@@ -29,11 +29,11 @@ namespace OpenSim
29{ 29{
30 public class VersionInfo 30 public class VersionInfo
31 { 31 {
32 private const string VERSION_NUMBER = "0.8.0"; 32 private const string VERSION_NUMBER = "0.8.0CM";
33 private const Flavour VERSION_FLAVOUR = Flavour.Dev; 33 private const Flavour VERSION_FLAVOUR = Flavour.Dev;
34 34
35 public enum Flavour 35 public enum Flavour
36 { 36 {
37 Unknown, 37 Unknown,
38 Dev, 38 Dev,
39 RC1, 39 RC1,
@@ -50,7 +50,7 @@ namespace OpenSim
50 50
51 public static string GetVersionString(string versionNumber, Flavour flavour) 51 public static string GetVersionString(string versionNumber, Flavour flavour)
52 { 52 {
53 string versionString = "OpenSim " + versionNumber + " " + flavour; 53 string versionString = "Careminster " + versionNumber + " " + flavour;
54 return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); 54 return versionString.PadRight(VERSIONINFO_VERSION_LENGTH);
55 } 55 }
56 56
diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs
index 8af2c41..62ecbd1 100644
--- a/OpenSim/Framework/TaskInventoryDictionary.cs
+++ b/OpenSim/Framework/TaskInventoryDictionary.cs
@@ -27,9 +27,13 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Threading;
31using System.Reflection;
30using System.Xml; 32using System.Xml;
33using System.Diagnostics;
31using System.Xml.Schema; 34using System.Xml.Schema;
32using System.Xml.Serialization; 35using System.Xml.Serialization;
36using log4net;
33using OpenMetaverse; 37using OpenMetaverse;
34 38
35namespace OpenSim.Framework 39namespace OpenSim.Framework
@@ -47,6 +51,180 @@ namespace OpenSim.Framework
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 52
49 private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); 53 private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55
56 private Thread LockedByThread;
57// private string WriterStack;
58
59// private Dictionary<Thread, string> ReadLockers =
60// new Dictionary<Thread, string>();
61
62 /// <value>
63 /// An advanced lock for inventory data
64 /// </value>
65 private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
66
67 /// <summary>
68 /// Are we readlocked by the calling thread?
69 /// </summary>
70 public bool IsReadLockedByMe()
71 {
72 if (m_itemLock.RecursiveReadCount > 0)
73 {
74 return true;
75 }
76 else
77 {
78 return false;
79 }
80 }
81
82 /// <summary>
83 /// Lock our inventory list for reading (many can read, one can write)
84 /// </summary>
85 public void LockItemsForRead(bool locked)
86 {
87 if (locked)
88 {
89 if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
90 {
91 if (!LockedByThread.IsAlive)
92 {
93 //Locked by dead thread, reset.
94 m_itemLock = new System.Threading.ReaderWriterLockSlim();
95 }
96 }
97
98 if (m_itemLock.RecursiveReadCount > 0)
99 {
100 m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
101 try
102 {
103 // That call stack is useful for end users only. RealProgrammers need a full dump. Commented.
104 // StackTrace stackTrace = new StackTrace(); // get call stack
105 // StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
106 //
107 // // write call stack method names
108 // foreach (StackFrame stackFrame in stackFrames)
109 // {
110 // m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name
111 // }
112
113 // The below is far more useful
114// System.Console.WriteLine("------------------------------------------");
115// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
116// System.Console.WriteLine("------------------------------------------");
117// foreach (KeyValuePair<Thread, string> kvp in ReadLockers)
118// {
119// System.Console.WriteLine("Locker name {0} call stack:\n" + kvp.Value, kvp.Key.Name);
120// System.Console.WriteLine("------------------------------------------");
121// }
122 }
123 catch
124 {}
125 m_itemLock.ExitReadLock();
126 }
127 if (m_itemLock.RecursiveWriteCount > 0)
128 {
129 m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
130// try
131// {
132// System.Console.WriteLine("------------------------------------------");
133// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
134// System.Console.WriteLine("------------------------------------------");
135// System.Console.WriteLine("Locker's call stack:\n" + WriterStack);
136// System.Console.WriteLine("------------------------------------------");
137// }
138// catch
139// {}
140 m_itemLock.ExitWriteLock();
141 }
142
143 while (!m_itemLock.TryEnterReadLock(60000))
144 {
145 m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
146 if (m_itemLock.IsWriteLockHeld)
147 {
148 m_itemLock = new System.Threading.ReaderWriterLockSlim();
149// System.Console.WriteLine("------------------------------------------");
150// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
151// System.Console.WriteLine("------------------------------------------");
152// System.Console.WriteLine("Locker's call stack:\n" + WriterStack);
153// System.Console.WriteLine("------------------------------------------");
154// LockedByThread = null;
155// ReadLockers.Clear();
156 }
157 }
158// ReadLockers[Thread.CurrentThread] = Environment.StackTrace;
159 }
160 else
161 {
162 if (m_itemLock.RecursiveReadCount>0)
163 {
164 m_itemLock.ExitReadLock();
165 }
166// if (m_itemLock.RecursiveReadCount == 0)
167// ReadLockers.Remove(Thread.CurrentThread);
168 }
169 }
170
171 /// <summary>
172 /// Lock our inventory list for writing (many can read, one can write)
173 /// </summary>
174 public void LockItemsForWrite(bool locked)
175 {
176 if (locked)
177 {
178 //Enter a write lock, wait indefinately for one to open.
179 if (m_itemLock.RecursiveReadCount > 0)
180 {
181 m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
182 m_itemLock.ExitReadLock();
183 }
184 if (m_itemLock.RecursiveWriteCount > 0)
185 {
186 m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
187
188 m_itemLock.ExitWriteLock();
189 }
190 while (!m_itemLock.TryEnterWriteLock(60000))
191 {
192 if (m_itemLock.IsWriteLockHeld)
193 {
194 m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
195// System.Console.WriteLine("------------------------------------------");
196// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
197// System.Console.WriteLine("------------------------------------------");
198// System.Console.WriteLine("Locker's call stack:\n" + WriterStack);
199// System.Console.WriteLine("------------------------------------------");
200 }
201 else
202 {
203 m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by a reader. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
204// System.Console.WriteLine("------------------------------------------");
205// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
206// System.Console.WriteLine("------------------------------------------");
207// foreach (KeyValuePair<Thread, string> kvp in ReadLockers)
208// {
209// System.Console.WriteLine("Locker name {0} call stack:\n" + kvp.Value, kvp.Key.Name);
210// System.Console.WriteLine("------------------------------------------");
211// }
212 }
213 m_itemLock = new System.Threading.ReaderWriterLockSlim();
214// ReadLockers.Clear();
215 }
216
217 LockedByThread = Thread.CurrentThread;
218// WriterStack = Environment.StackTrace;
219 }
220 else
221 {
222 if (m_itemLock.RecursiveWriteCount > 0)
223 {
224 m_itemLock.ExitWriteLock();
225 }
226 }
227 }
50 228
51 #region ICloneable Members 229 #region ICloneable Members
52 230
@@ -54,14 +232,13 @@ namespace OpenSim.Framework
54 { 232 {
55 TaskInventoryDictionary clone = new TaskInventoryDictionary(); 233 TaskInventoryDictionary clone = new TaskInventoryDictionary();
56 234
57 lock (this) 235 m_itemLock.EnterReadLock();
236 foreach (UUID uuid in Keys)
58 { 237 {
59 foreach (UUID uuid in Keys) 238 clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
60 {
61 clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
62 }
63 } 239 }
64 240 m_itemLock.ExitReadLock();
241
65 return clone; 242 return clone;
66 } 243 }
67 244
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs
index 307cb75..2ec4bd1 100644
--- a/OpenSim/Framework/TaskInventoryItem.cs
+++ b/OpenSim/Framework/TaskInventoryItem.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework
72 private UUID _loadedID = UUID.Zero; 72 private UUID _loadedID = UUID.Zero;
73 73
74 private bool _ownerChanged = false; 74 private bool _ownerChanged = false;
75 75
76 public UUID AssetID { 76 public UUID AssetID {
77 get { 77 get {
78 return _assetID; 78 return _assetID;
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
index 3f0a031..08f2af5 100644
--- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
+++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
@@ -218,12 +218,12 @@ namespace OpenSim.Framework.Tests
218 BannedHostNameMask = string.Empty, 218 BannedHostNameMask = string.Empty,
219 BannedUserID = bannedUserId} 219 BannedUserID = bannedUserId}
220 ); 220 );
221 Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not."); 221 Assert.IsTrue(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
222 Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is."); 222 Assert.IsFalse(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is.");
223 223
224 es.RemoveBan(bannedUserId); 224 es.RemoveBan(bannedUserId);
225 225
226 Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is."); 226 Assert.IsFalse(es.IsBanned(bannedUserId, 32), "User Should not be banned but is.");
227 227
228 es.AddEstateManager(UUID.Zero); 228 es.AddEstateManager(UUID.Zero);
229 229
diff --git a/OpenSim/Framework/ThrottleOutPacketType.cs b/OpenSim/Framework/ThrottleOutPacketType.cs
index ca4b126..87899f0 100644
--- a/OpenSim/Framework/ThrottleOutPacketType.cs
+++ b/OpenSim/Framework/ThrottleOutPacketType.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Framework
47 Texture = 5, 47 Texture = 5,
48 /// <summary>Non-texture assets</summary> 48 /// <summary>Non-texture assets</summary>
49 Asset = 6, 49 Asset = 6,
50
51 HighPriority = 128,
50 } 52 }
51 53
52 [Flags] 54 [Flags]
diff --git a/OpenSim/Framework/UserProfiles.cs b/OpenSim/Framework/UserProfiles.cs
index 492f6b9..6133591 100644
--- a/OpenSim/Framework/UserProfiles.cs
+++ b/OpenSim/Framework/UserProfiles.cs
@@ -90,14 +90,6 @@ namespace OpenSim.Framework
90 public UUID TargetId; 90 public UUID TargetId;
91 public string Notes; 91 public string Notes;
92 } 92 }
93
94 public class UserPreferences
95 {
96 public UUID UserId;
97 public bool IMViaEmail = false;
98 public bool Visible = false;
99 public string EMail = string.Empty;
100 }
101 93
102 public class UserAccountProperties 94 public class UserAccountProperties
103 { 95 {
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 7bc8176..1775fef 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -583,19 +583,25 @@ namespace OpenSim.Framework
583 /// </summary> 583 /// </summary>
584 /// <param name="data"></param> 584 /// <param name="data"></param>
585 /// <returns></returns> 585 /// <returns></returns>
586
586 public static string Md5Hash(string data) 587 public static string Md5Hash(string data)
587 { 588 {
588 byte[] dataMd5 = ComputeMD5Hash(data); 589 return Md5Hash(data, Encoding.Default);
590 }
591
592 public static string Md5Hash(string data, Encoding encoding)
593 {
594 byte[] dataMd5 = ComputeMD5Hash(data, encoding);
589 StringBuilder sb = new StringBuilder(); 595 StringBuilder sb = new StringBuilder();
590 for (int i = 0; i < dataMd5.Length; i++) 596 for (int i = 0; i < dataMd5.Length; i++)
591 sb.AppendFormat("{0:x2}", dataMd5[i]); 597 sb.AppendFormat("{0:x2}", dataMd5[i]);
592 return sb.ToString(); 598 return sb.ToString();
593 } 599 }
594 600
595 private static byte[] ComputeMD5Hash(string data) 601 private static byte[] ComputeMD5Hash(string data, Encoding encoding)
596 { 602 {
597 MD5 md5 = MD5.Create(); 603 MD5 md5 = MD5.Create();
598 return md5.ComputeHash(Encoding.Default.GetBytes(data)); 604 return md5.ComputeHash(encoding.GetBytes(data));
599 } 605 }
600 606
601 /// <summary> 607 /// <summary>
@@ -603,6 +609,12 @@ namespace OpenSim.Framework
603 /// </summary> 609 /// </summary>
604 /// <param name="data"></param> 610 /// <param name="data"></param>
605 /// <returns></returns> 611 /// <returns></returns>
612
613 public static string SHA1Hash(string data, Encoding enc)
614 {
615 return SHA1Hash(enc.GetBytes(data));
616 }
617
606 public static string SHA1Hash(string data) 618 public static string SHA1Hash(string data)
607 { 619 {
608 return SHA1Hash(Encoding.Default.GetBytes(data)); 620 return SHA1Hash(Encoding.Default.GetBytes(data));
@@ -1344,19 +1356,19 @@ namespace OpenSim.Framework
1344 { 1356 {
1345 string os = String.Empty; 1357 string os = String.Empty;
1346 1358
1347 if (Environment.OSVersion.Platform != PlatformID.Unix) 1359// if (Environment.OSVersion.Platform != PlatformID.Unix)
1348 { 1360// {
1349 os = Environment.OSVersion.ToString(); 1361// os = Environment.OSVersion.ToString();
1350 } 1362// }
1351 else 1363// else
1352 { 1364// {
1353 os = ReadEtcIssue(); 1365// os = ReadEtcIssue();
1354 } 1366// }
1355 1367//
1356 if (os.Length > 45) 1368// if (os.Length > 45)
1357 { 1369// {
1358 os = os.Substring(0, 45); 1370// os = os.Substring(0, 45);
1359 } 1371// }
1360 1372
1361 return os; 1373 return os;
1362 } 1374 }
@@ -1488,7 +1500,7 @@ namespace OpenSim.Framework
1488 1500
1489 public static Guid GetHashGuid(string data, string salt) 1501 public static Guid GetHashGuid(string data, string salt)
1490 { 1502 {
1491 byte[] hash = ComputeMD5Hash(data + salt); 1503 byte[] hash = ComputeMD5Hash(data + salt, Encoding.Default);
1492 1504
1493 //string s = BitConverter.ToString(hash); 1505 //string s = BitConverter.ToString(hash);
1494 1506
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index bcf6af8..33ef8e0 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -284,6 +284,7 @@ namespace OpenSim.Framework
284 catch (Exception ex) 284 catch (Exception ex)
285 { 285 {
286 errorMessage = ex.Message; 286 errorMessage = ex.Message;
287 m_log.Debug("[WEB UTIL]: Exception making request: " + ex.ToString());
287 } 288 }
288 finally 289 finally
289 { 290 {
@@ -367,7 +368,7 @@ namespace OpenSim.Framework
367 /// </summary> 368 /// </summary>
368 public static OSDMap PostToService(string url, NameValueCollection data) 369 public static OSDMap PostToService(string url, NameValueCollection data)
369 { 370 {
370 return ServiceFormRequest(url,data,10000); 371 return ServiceFormRequest(url,data, 20000);
371 } 372 }
372 373
373 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) 374 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
@@ -785,7 +786,8 @@ namespace OpenSim.Framework
785 reqnum, verb, requestUrl); 786 reqnum, verb, requestUrl);
786 787
787 int tickstart = Util.EnvironmentTickCount(); 788 int tickstart = Util.EnvironmentTickCount();
788 int tickdata = 0; 789// int tickdata = 0;
790 int tickdiff = 0;
789 791
790 Type type = typeof(TRequest); 792 Type type = typeof(TRequest);
791 793
@@ -831,8 +833,8 @@ namespace OpenSim.Framework
831 requestStream.Close(); 833 requestStream.Close();
832 834
833 // capture how much time was spent writing 835 // capture how much time was spent writing
834 tickdata = Util.EnvironmentTickCountSubtract(tickstart); 836 // useless in this async
835 837// tickdata = Util.EnvironmentTickCountSubtract(tickstart);
836 request.BeginGetResponse(delegate(IAsyncResult ar) 838 request.BeginGetResponse(delegate(IAsyncResult ar)
837 { 839 {
838 response = request.EndGetResponse(ar); 840 response = request.EndGetResponse(ar);
@@ -849,7 +851,8 @@ namespace OpenSim.Framework
849 finally 851 finally
850 { 852 {
851 // Let's not close this 853 // Let's not close this
852 //buffer.Close(); 854 // yes do close it
855 buffer.Close();
853 respStream.Close(); 856 respStream.Close();
854 response.Close(); 857 response.Close();
855 } 858 }
@@ -918,7 +921,6 @@ namespace OpenSim.Framework
918 } 921 }
919 922
920 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); 923 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
921
922 try 924 try
923 { 925 {
924 action(deserial); 926 action(deserial);
@@ -933,9 +935,10 @@ namespace OpenSim.Framework
933 }, null); 935 }, null);
934 } 936 }
935 937
936 int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); 938 tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
937 if (tickdiff > WebUtil.LongCallTime) 939 if (tickdiff > WebUtil.LongCallTime)
938 { 940 {
941/*
939 string originalRequest = null; 942 string originalRequest = null;
940 943
941 if (buffer != null) 944 if (buffer != null)
@@ -954,12 +957,19 @@ namespace OpenSim.Framework
954 tickdiff, 957 tickdiff,
955 tickdata, 958 tickdata,
956 originalRequest); 959 originalRequest);
960*/
961 m_log.InfoFormat(
962 "[ASYNC REQUEST]: Slow WebRequest SETUP <{0}> {1} {2} took {3}ms",
963 reqnum,
964 verb,
965 requestUrl,
966 tickdiff);
957 } 967 }
958 else if (WebUtil.DebugLevel >= 4) 968 else if (WebUtil.DebugLevel >= 4)
959 { 969 {
960 m_log.DebugFormat( 970 m_log.DebugFormat(
961 "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", 971 "[WEB UTIL]: HTTP OUT {0} took {1}ms",
962 reqnum, tickdiff, tickdata); 972 reqnum, tickdiff);
963 } 973 }
964 } 974 }
965 } 975 }
@@ -997,6 +1007,8 @@ namespace OpenSim.Framework
997 request.Timeout = timeoutsecs * 1000; 1007 request.Timeout = timeoutsecs * 1000;
998 string respstring = String.Empty; 1008 string respstring = String.Empty;
999 1009
1010 int tickset = Util.EnvironmentTickCountSubtract(tickstart);
1011
1000 using (MemoryStream buffer = new MemoryStream()) 1012 using (MemoryStream buffer = new MemoryStream())
1001 { 1013 {
1002 if ((verb == "POST") || (verb == "PUT")) 1014 if ((verb == "POST") || (verb == "PUT"))
@@ -1079,6 +1091,7 @@ namespace OpenSim.Framework
1079 verb, 1091 verb,
1080 requestUrl, 1092 requestUrl,
1081 tickdiff, 1093 tickdiff,
1094 tickset,
1082 tickdata, 1095 tickdata,
1083 obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); 1096 obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
1084 else if (WebUtil.DebugLevel >= 4) 1097 else if (WebUtil.DebugLevel >= 4)
@@ -1142,6 +1155,8 @@ namespace OpenSim.Framework
1142 ht.ServicePoint.ConnectionLimit = maxConnections; 1155 ht.ServicePoint.ConnectionLimit = maxConnections;
1143 1156
1144 request.Method = verb; 1157 request.Method = verb;
1158 if (pTimeout != 0)
1159 request.Timeout = pTimeout * 1000;
1145 MemoryStream buffer = null; 1160 MemoryStream buffer = null;
1146 1161
1147 if ((verb == "POST") || (verb == "PUT")) 1162 if ((verb == "POST") || (verb == "PUT"))