aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorubit2012-07-06 02:10:05 +0200
committerubit2012-07-06 02:10:05 +0200
commita2c0de4c106fd04c9490deb161206ccb26ed0f53 (patch)
tree1382449c2bfe54d2babf925307b1b87ee7657f99
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentChanged GetTexture error code RequestedRangeNotSatisfiable to NotFound, since... (diff)
downloadopensim-SC_OLD-a2c0de4c106fd04c9490deb161206ccb26ed0f53.zip
opensim-SC_OLD-a2c0de4c106fd04c9490deb161206ccb26ed0f53.tar.gz
opensim-SC_OLD-a2c0de4c106fd04c9490deb161206ccb26ed0f53.tar.bz2
opensim-SC_OLD-a2c0de4c106fd04c9490deb161206ccb26ed0f53.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs4
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs8
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs51
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
5 files changed, 56 insertions, 17 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 217217e..0797215 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -226,7 +226,9 @@ namespace OpenSim.Capabilities.Handlers
226 // sending back the last byte instead of an error status 226 // sending back the last byte instead of an error status
227 if (start >= texture.Data.Length) 227 if (start >= texture.Data.Length)
228 { 228 {
229 response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; 229// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
230 // viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters
231 response.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
230 } 232 }
231 else 233 else
232 { 234 {
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index 2407533..7c92a50 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -45,6 +45,13 @@ namespace OpenSim.Framework.Servers.HttpServer
45 public RequestMethod Request; 45 public RequestMethod Request;
46 public UUID Id; 46 public UUID Id;
47 public int TimeOutms; 47 public int TimeOutms;
48 public EventType Type;
49
50 public enum EventType : int
51 {
52 Normal = 0,
53 LslHttp = 1
54 }
48 55
49 public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents, UUID pId, int pTimeOutms) 56 public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents, UUID pId, int pTimeOutms)
50 { 57 {
@@ -54,6 +61,7 @@ namespace OpenSim.Framework.Servers.HttpServer
54 NoEvents = pNoEvents; 61 NoEvents = pNoEvents;
55 Id = pId; 62 Id = pId;
56 TimeOutms = pTimeOutms; 63 TimeOutms = pTimeOutms;
64 Type = EventType.Normal;
57 } 65 }
58 } 66 }
59} 67}
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 45b1375..6f87c85 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -174,13 +174,15 @@ namespace OpenSim.Framework.Servers.HttpServer
174 private readonly BaseHttpServer m_server; 174 private readonly BaseHttpServer m_server;
175 175
176 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); 176 private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>();
177 private static Queue<PollServiceHttpRequest> m_retry_requests = new Queue<PollServiceHttpRequest>(); 177 private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>();
178 private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>();
178 179
179 private uint m_WorkerThreadCount = 0; 180 private uint m_WorkerThreadCount = 0;
180 private Thread[] m_workerThreads; 181 private Thread[] m_workerThreads;
181 private Thread m_retrysThread; 182 private Thread m_retrysThread;
182 183
183 private bool m_running = true; 184 private bool m_running = true;
185 private int slowCount = 0;
184 186
185// private int m_timeout = 1000; // increase timeout 250; now use the event one 187// private int m_timeout = 1000; // increase timeout 250; now use the event one
186 188
@@ -195,7 +197,7 @@ namespace OpenSim.Framework.Servers.HttpServer
195 { 197 {
196 m_workerThreads[i] 198 m_workerThreads[i]
197 = Watchdog.StartThread( 199 = Watchdog.StartThread(
198 poolWorkerJob, 200 PoolWorkerJob,
199 String.Format("PollServiceWorkerThread{0}", i), 201 String.Format("PollServiceWorkerThread{0}", i),
200 ThreadPriority.Normal, 202 ThreadPriority.Normal,
201 false, 203 false,
@@ -217,15 +219,25 @@ namespace OpenSim.Framework.Servers.HttpServer
217 { 219 {
218 if (m_running) 220 if (m_running)
219 { 221 {
220 lock (m_retry_requests) 222 lock (m_retryRequests)
221 m_retry_requests.Enqueue(req); 223 m_retryRequests.Enqueue(req);
222 } 224 }
223 } 225 }
224 226
225 public void Enqueue(PollServiceHttpRequest req) 227 public void Enqueue(PollServiceHttpRequest req)
226 { 228 {
227 if (m_running) 229 if (m_running)
228 m_requests.Enqueue(req); 230 {
231 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LslHttp)
232 {
233 m_requests.Enqueue(req);
234 }
235 else
236 {
237 lock (m_slowRequests)
238 m_slowRequests.Enqueue(req);
239 }
240 }
229 } 241 }
230 242
231 private void CheckRetries() 243 private void CheckRetries()
@@ -234,10 +246,21 @@ namespace OpenSim.Framework.Servers.HttpServer
234 { 246 {
235 Thread.Sleep(100); // let the world move .. back to faster rate 247 Thread.Sleep(100); // let the world move .. back to faster rate
236 Watchdog.UpdateThread(); 248 Watchdog.UpdateThread();
237 lock (m_retry_requests) 249 lock (m_retryRequests)
238 { 250 {
239 while (m_retry_requests.Count > 0 && m_running) 251 while (m_retryRequests.Count > 0 && m_running)
240 Enqueue(m_retry_requests.Dequeue()); 252 m_requests.Enqueue(m_retryRequests.Dequeue());
253 }
254 slowCount++;
255 if (slowCount >= 10)
256 {
257 slowCount = 0;
258
259 lock (m_slowRequests)
260 {
261 while (m_slowRequests.Count > 0 && m_running)
262 m_requests.Enqueue(m_slowRequests.Dequeue());
263 }
241 } 264 }
242 } 265 }
243 } 266 }
@@ -261,7 +284,7 @@ namespace OpenSim.Framework.Servers.HttpServer
261 284
262 try 285 try
263 { 286 {
264 foreach (PollServiceHttpRequest req in m_retry_requests) 287 foreach (PollServiceHttpRequest req in m_retryRequests)
265 { 288 {
266 m_server.DoHTTPGruntWork( 289 m_server.DoHTTPGruntWork(
267 req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), 290 req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
@@ -273,7 +296,13 @@ namespace OpenSim.Framework.Servers.HttpServer
273 } 296 }
274 297
275 PollServiceHttpRequest wreq; 298 PollServiceHttpRequest wreq;
276 m_retry_requests.Clear(); 299 m_retryRequests.Clear();
300
301 lock (m_slowRequests)
302 {
303 while (m_slowRequests.Count > 0 && m_running)
304 m_requests.Enqueue(m_slowRequests.Dequeue());
305 }
277 306
278 while (m_requests.Count() > 0) 307 while (m_requests.Count() > 0)
279 { 308 {
@@ -294,7 +323,7 @@ namespace OpenSim.Framework.Servers.HttpServer
294 323
295 // work threads 324 // work threads
296 325
297 private void poolWorkerJob() 326 private void PoolWorkerJob()
298 { 327 {
299 PollServiceHttpRequest req; 328 PollServiceHttpRequest req;
300 StreamReader str; 329 StreamReader str;
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index e93266c..9c5596b 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -172,9 +172,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
172 172
173 string uri = "/lslhttp/" + urlcode.ToString(); 173 string uri = "/lslhttp/" + urlcode.ToString();
174 174
175 m_HttpServer.AddPollServiceHTTPHandler( 175 PollServiceEventArgs args = new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode, 25000);
176 uri, 176 args.Type = PollServiceEventArgs.EventType.LslHttp;
177 new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode,25000)); 177 m_HttpServer.AddPollServiceHTTPHandler(uri, args);
178 178
179 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 179 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
180 } 180 }
@@ -422,7 +422,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
422 } 422 }
423 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) 423 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
424 { 424 {
425 UrlData url = null; 425 UrlData url = null;
426 RequestData requestData = null; 426 RequestData requestData = null;
427 427
428 lock (m_RequestMap) 428 lock (m_RequestMap)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index fd8e586..5808594 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7479,7 +7479,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7479 public LSL_String llSHA1String(string src) 7479 public LSL_String llSHA1String(string src)
7480 { 7480 {
7481 m_host.AddScriptLPS(1); 7481 m_host.AddScriptLPS(1);
7482 return Util.SHA1Hash(src, Encoding.UTF8).ToUpper(); 7482 return Util.SHA1Hash(src, Encoding.UTF8).ToLower();
7483 } 7483 }
7484 7484
7485 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, byte profileshape, byte pathcurve) 7485 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, byte profileshape, byte pathcurve)