diff options
author | ubit | 2012-09-25 05:05:14 +0200 |
---|---|---|
committer | ubit | 2012-09-25 05:05:14 +0200 |
commit | 96ebf7b029c8c9f36b6cfb79d7d98980483f7444 (patch) | |
tree | 986bb56e53e2ce7ff45dbbe34d41c38901694c2c /OpenSim/Region/ClientStack | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | missed change (diff) | |
download | opensim-SC-96ebf7b029c8c9f36b6cfb79d7d98980483f7444.zip opensim-SC-96ebf7b029c8c9f36b6cfb79d7d98980483f7444.tar.gz opensim-SC-96ebf7b029c8c9f36b6cfb79d7d98980483f7444.tar.bz2 opensim-SC-96ebf7b029c8c9f36b6cfb79d7d98980483f7444.tar.xz |
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to '')
3 files changed, 62 insertions, 67 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 4a323d8..c705f10 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -596,7 +596,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
596 | 596 | ||
597 | 597 | ||
598 | if(IsAtestUpload) // let user know, still showing cost estimation | 598 | if(IsAtestUpload) // let user know, still showing cost estimation |
599 | warning += "Upload will have no cost, for personal test purposes only. Other uses are forbiden. Items may not work on another region"; | 599 | warning += "Upload will have no cost, for testing purposes only. Other uses are prohibited. Items will not work after 48 hours or on other regions"; |
600 | 600 | ||
601 | // check funds | 601 | // check funds |
602 | else | 602 | else |
@@ -982,7 +982,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
982 | } | 982 | } |
983 | 983 | ||
984 | if(istest) | 984 | if(istest) |
985 | prim.Description = "For personal testing only. Other uses are forbiden"; | 985 | prim.Description = "For testing only. Other uses are prohibited"; |
986 | else | 986 | else |
987 | prim.Description = ""; | 987 | prim.Description = ""; |
988 | 988 | ||
@@ -1066,7 +1066,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1066 | item.AssetID = asset.FullID; | 1066 | item.AssetID = asset.FullID; |
1067 | if (istest) | 1067 | if (istest) |
1068 | { | 1068 | { |
1069 | item.Description = "For personal testing only. Other uses are forbiden"; | 1069 | item.Description = "For testing only. Other uses are prohibited"; |
1070 | item.Flags = (uint) (InventoryItemFlags.SharedSingleReference); | 1070 | item.Flags = (uint) (InventoryItemFlags.SharedSingleReference); |
1071 | } | 1071 | } |
1072 | else | 1072 | else |
@@ -1541,7 +1541,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1541 | if (m_IsAtestUpload) | 1541 | if (m_IsAtestUpload) |
1542 | { | 1542 | { |
1543 | LLSDAssetUploadError resperror = new LLSDAssetUploadError(); | 1543 | LLSDAssetUploadError resperror = new LLSDAssetUploadError(); |
1544 | resperror.message = "Upload SUCESSEFULL for testing purposes only. Other uses are forbiden. Item may not work on other region"; | 1544 | resperror.message = "Upload SUCESSEFULL for testing purposes only. Other uses are prohibited. Item will not work after 48 hours or on other regions"; |
1545 | resperror.identifier = inv; | 1545 | resperror.identifier = inv; |
1546 | 1546 | ||
1547 | uploadComplete.error = resperror; | 1547 | uploadComplete.error = resperror; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index 2000279..b16076d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -53,6 +53,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetTextureModule")] | 53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetTextureModule")] |
54 | public class GetTextureModule : INonSharedRegionModule | 54 | public class GetTextureModule : INonSharedRegionModule |
55 | { | 55 | { |
56 | |||
57 | struct aPollRequest | ||
58 | { | ||
59 | public PollServiceTextureEventArgs thepoll; | ||
60 | public UUID reqID; | ||
61 | public Hashtable request; | ||
62 | } | ||
63 | |||
56 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 64 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
57 | 65 | ||
58 | private Scene m_scene; | 66 | private Scene m_scene; |
@@ -64,8 +72,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
64 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); | 72 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); |
65 | private static Thread[] m_workerThreads = null; | 73 | private static Thread[] m_workerThreads = null; |
66 | 74 | ||
67 | private static OpenMetaverse.BlockingQueue<PollServiceTextureEventArgs> m_queue = | 75 | private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = |
68 | new OpenMetaverse.BlockingQueue<PollServiceTextureEventArgs>(); | 76 | new OpenMetaverse.BlockingQueue<aPollRequest>(); |
69 | 77 | ||
70 | #region ISharedRegionModule Members | 78 | #region ISharedRegionModule Members |
71 | 79 | ||
@@ -104,7 +112,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
104 | String.Format("TextureWorkerThread{0}", i), | 112 | String.Format("TextureWorkerThread{0}", i), |
105 | ThreadPriority.Normal, | 113 | ThreadPriority.Normal, |
106 | false, | 114 | false, |
107 | true, | 115 | false, |
108 | null, | 116 | null, |
109 | int.MaxValue); | 117 | int.MaxValue); |
110 | } | 118 | } |
@@ -129,7 +137,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
129 | ~GetTextureModule() | 137 | ~GetTextureModule() |
130 | { | 138 | { |
131 | foreach (Thread t in m_workerThreads) | 139 | foreach (Thread t in m_workerThreads) |
132 | t.Abort(); | 140 | Watchdog.AbortThread(t.ManagedThreadId); |
141 | |||
133 | } | 142 | } |
134 | 143 | ||
135 | private class PollServiceTextureEventArgs : PollServiceEventArgs | 144 | private class PollServiceTextureEventArgs : PollServiceEventArgs |
@@ -142,7 +151,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
142 | private Scene m_scene; | 151 | private Scene m_scene; |
143 | 152 | ||
144 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : | 153 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : |
145 | base(null, null, null, null, pId, 30000) | 154 | base(null, null, null, null, pId, int.MaxValue) |
155 | // this should never timeout | ||
156 | // each request must be processed and return a response | ||
157 | // noevents can possible be use for nice shutdown, but not sure now | ||
158 | // the execution will provide a proper response even if it fails | ||
159 | |||
146 | { | 160 | { |
147 | m_scene = scene; | 161 | m_scene = scene; |
148 | 162 | ||
@@ -164,21 +178,24 @@ namespace OpenSim.Region.ClientStack.Linden | |||
164 | 178 | ||
165 | Request = (x, y) => | 179 | Request = (x, y) => |
166 | { | 180 | { |
167 | y["RequestID"] = x.ToString(); | 181 | aPollRequest reqinfo = new aPollRequest(); |
168 | lock (requests) | 182 | reqinfo.thepoll = this; |
169 | requests.Add(y); | 183 | reqinfo.reqID = x; |
184 | reqinfo.request = y; | ||
170 | 185 | ||
171 | m_queue.Enqueue(this); | 186 | m_queue.Enqueue(reqinfo); |
172 | }; | 187 | }; |
173 | 188 | ||
189 | // this should never happen except possible on shutdown | ||
174 | NoEvents = (x, y) => | 190 | NoEvents = (x, y) => |
175 | { | 191 | { |
192 | /* | ||
176 | lock (requests) | 193 | lock (requests) |
177 | { | 194 | { |
178 | Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); | 195 | Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); |
179 | requests.Remove(request); | 196 | requests.Remove(request); |
180 | } | 197 | } |
181 | 198 | */ | |
182 | Hashtable response = new Hashtable(); | 199 | Hashtable response = new Hashtable(); |
183 | 200 | ||
184 | response["int_response_code"] = 500; | 201 | response["int_response_code"] = 500; |
@@ -191,27 +208,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
191 | }; | 208 | }; |
192 | } | 209 | } |
193 | 210 | ||
194 | public void Process() | 211 | public void Process(aPollRequest requestinfo) |
195 | { | 212 | { |
196 | Hashtable response; | 213 | Hashtable response; |
197 | Hashtable request = null; | ||
198 | 214 | ||
199 | try | 215 | UUID requestID = requestinfo.reqID; |
200 | { | ||
201 | lock (requests) | ||
202 | { | ||
203 | request = requests[0]; | ||
204 | requests.RemoveAt(0); | ||
205 | } | ||
206 | } | ||
207 | catch | ||
208 | { | ||
209 | return; | ||
210 | } | ||
211 | |||
212 | UUID requestID = new UUID(request["RequestID"].ToString()); | ||
213 | 216 | ||
214 | // If the avatar is gone, don't bother to get the texture | 217 | // If the avatar is gone, don't bother to get the texture |
218 | |||
215 | if (m_scene.GetScenePresence(Id) == null) | 219 | if (m_scene.GetScenePresence(Id) == null) |
216 | { | 220 | { |
217 | response = new Hashtable(); | 221 | response = new Hashtable(); |
@@ -228,7 +232,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
228 | return; | 232 | return; |
229 | } | 233 | } |
230 | 234 | ||
231 | response = m_getTextureHandler.Handle(request); | 235 | response = m_getTextureHandler.Handle(requestinfo.request); |
232 | lock (responses) | 236 | lock (responses) |
233 | responses[requestID] = response; | 237 | responses[requestID] = response; |
234 | } | 238 | } |
@@ -275,11 +279,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
275 | { | 279 | { |
276 | while (true) | 280 | while (true) |
277 | { | 281 | { |
278 | PollServiceTextureEventArgs args = m_queue.Dequeue(); | 282 | aPollRequest poolreq = m_queue.Dequeue(); |
279 | 283 | ||
280 | args.Process(); | 284 | poolreq.thepoll.Process(poolreq); |
281 | } | 285 | } |
282 | } | 286 | } |
283 | } | 287 | } |
284 | |||
285 | } | 288 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index f76ea74..0f305b1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -52,6 +52,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
52 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 52 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
53 | public class WebFetchInvDescModule : INonSharedRegionModule | 53 | public class WebFetchInvDescModule : INonSharedRegionModule |
54 | { | 54 | { |
55 | struct aPollRequest | ||
56 | { | ||
57 | public PollServiceInventoryEventArgs thepoll; | ||
58 | public UUID reqID; | ||
59 | public Hashtable request; | ||
60 | } | ||
61 | |||
55 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 62 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
56 | 63 | ||
57 | private Scene m_scene; | 64 | private Scene m_scene; |
@@ -64,8 +71,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
64 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); | 71 | private Dictionary<UUID, string> m_capsDict = new Dictionary<UUID, string>(); |
65 | private static Thread[] m_workerThreads = null; | 72 | private static Thread[] m_workerThreads = null; |
66 | 73 | ||
67 | private static OpenMetaverse.BlockingQueue<PollServiceInventoryEventArgs> m_queue = | 74 | private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = |
68 | new OpenMetaverse.BlockingQueue<PollServiceInventoryEventArgs>(); | 75 | new OpenMetaverse.BlockingQueue<aPollRequest>(); |
69 | 76 | ||
70 | #region ISharedRegionModule Members | 77 | #region ISharedRegionModule Members |
71 | 78 | ||
@@ -131,18 +138,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
131 | ~WebFetchInvDescModule() | 138 | ~WebFetchInvDescModule() |
132 | { | 139 | { |
133 | foreach (Thread t in m_workerThreads) | 140 | foreach (Thread t in m_workerThreads) |
134 | t.Abort(); | 141 | Watchdog.AbortThread(t.ManagedThreadId); |
135 | } | 142 | } |
136 | 143 | ||
137 | private class PollServiceInventoryEventArgs : PollServiceEventArgs | 144 | private class PollServiceInventoryEventArgs : PollServiceEventArgs |
138 | { | 145 | { |
139 | private List<Hashtable> requests = | ||
140 | new List<Hashtable>(); | ||
141 | private Dictionary<UUID, Hashtable> responses = | 146 | private Dictionary<UUID, Hashtable> responses = |
142 | new Dictionary<UUID, Hashtable>(); | 147 | new Dictionary<UUID, Hashtable>(); |
143 | 148 | ||
144 | public PollServiceInventoryEventArgs(UUID pId) : | 149 | public PollServiceInventoryEventArgs(UUID pId) : |
145 | base(null, null, null, null, pId, 30000) | 150 | base(null, null, null, null, pId, int.MaxValue) |
146 | { | 151 | { |
147 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; | 152 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; |
148 | GetEvents = (x, y, s) => | 153 | GetEvents = (x, y, s) => |
@@ -162,21 +167,23 @@ namespace OpenSim.Region.ClientStack.Linden | |||
162 | 167 | ||
163 | Request = (x, y) => | 168 | Request = (x, y) => |
164 | { | 169 | { |
165 | y["RequestID"] = x.ToString(); | 170 | aPollRequest reqinfo = new aPollRequest(); |
166 | lock (requests) | 171 | reqinfo.thepoll = this; |
167 | requests.Add(y); | 172 | reqinfo.reqID = x; |
173 | reqinfo.request = y; | ||
168 | 174 | ||
169 | m_queue.Enqueue(this); | 175 | m_queue.Enqueue(reqinfo); |
170 | }; | 176 | }; |
171 | 177 | ||
172 | NoEvents = (x, y) => | 178 | NoEvents = (x, y) => |
173 | { | 179 | { |
180 | /* | ||
174 | lock (requests) | 181 | lock (requests) |
175 | { | 182 | { |
176 | Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); | 183 | Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString()); |
177 | requests.Remove(request); | 184 | requests.Remove(request); |
178 | } | 185 | } |
179 | 186 | */ | |
180 | Hashtable response = new Hashtable(); | 187 | Hashtable response = new Hashtable(); |
181 | 188 | ||
182 | response["int_response_code"] = 500; | 189 | response["int_response_code"] = 500; |
@@ -189,24 +196,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
189 | }; | 196 | }; |
190 | } | 197 | } |
191 | 198 | ||
192 | public void Process() | 199 | public void Process(aPollRequest requestinfo) |
193 | { | 200 | { |
194 | Hashtable request = null; | 201 | UUID requestID = requestinfo.reqID; |
195 | |||
196 | try | ||
197 | { | ||
198 | lock (requests) | ||
199 | { | ||
200 | request = requests[0]; | ||
201 | requests.RemoveAt(0); | ||
202 | } | ||
203 | } | ||
204 | catch | ||
205 | { | ||
206 | return; | ||
207 | } | ||
208 | |||
209 | UUID requestID = new UUID(request["RequestID"].ToString()); | ||
210 | 202 | ||
211 | Hashtable response = new Hashtable(); | 203 | Hashtable response = new Hashtable(); |
212 | 204 | ||
@@ -215,7 +207,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
215 | response["keepalive"] = false; | 207 | response["keepalive"] = false; |
216 | response["reusecontext"] = false; | 208 | response["reusecontext"] = false; |
217 | 209 | ||
218 | response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest(request["body"].ToString(), String.Empty, String.Empty, null, null); | 210 | response["str_response_string"] = m_webFetchHandler.FetchInventoryDescendentsRequest( |
211 | requestinfo.request["body"].ToString(), String.Empty, String.Empty, null, null); | ||
219 | 212 | ||
220 | lock (responses) | 213 | lock (responses) |
221 | responses[requestID] = response; | 214 | responses[requestID] = response; |
@@ -226,8 +219,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
226 | { | 219 | { |
227 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | 220 | string capUrl = "/CAPS/" + UUID.Random() + "/"; |
228 | 221 | ||
229 | // Register this as a poll service | 222 | // Register this as a poll service |
230 | // absurd large timeout to tune later to make a bit less than viewer | ||
231 | PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID); | 223 | PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID); |
232 | 224 | ||
233 | args.Type = PollServiceEventArgs.EventType.Inventory; | 225 | args.Type = PollServiceEventArgs.EventType.Inventory; |
@@ -263,9 +255,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
263 | { | 255 | { |
264 | while (true) | 256 | while (true) |
265 | { | 257 | { |
266 | PollServiceInventoryEventArgs args = m_queue.Dequeue(); | 258 | aPollRequest poolreq = m_queue.Dequeue(); |
267 | 259 | ||
268 | args.Process(); | 260 | poolreq.thepoll.Process(poolreq); |
269 | } | 261 | } |
270 | } | 262 | } |
271 | } | 263 | } |