diff options
author | Teravus Ovares | 2009-07-29 20:32:54 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-07-29 20:32:54 +0000 |
commit | f727f26bcc26a740a1bd0585e3cdeff0c8d81a25 (patch) | |
tree | 6131b08c94b65a9fea773a1853d382d85377b523 | |
parent | Thank you, coyled, for a patch to change Flotsamcache path generation (diff) | |
download | opensim-SC-f727f26bcc26a740a1bd0585e3cdeff0c8d81a25.zip opensim-SC-f727f26bcc26a740a1bd0585e3cdeff0c8d81a25.tar.gz opensim-SC-f727f26bcc26a740a1bd0585e3cdeff0c8d81a25.tar.bz2 opensim-SC-f727f26bcc26a740a1bd0585e3cdeff0c8d81a25.tar.xz |
* An attempt to fix mantis #3953
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | 4 | ||||
-rw-r--r-- | bin/HttpServer_OpenSim.dll | bin | 113152 -> 113664 bytes | |||
-rw-r--r-- | bin/HttpServer_OpenSim.pdb | bin | 302592 -> 304640 bytes |
8 files changed, 36 insertions, 8 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 369d7d4..f2a1da0 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -274,7 +274,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
274 | public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) | 274 | public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) |
275 | { | 275 | { |
276 | OSHttpRequest req = new OSHttpRequest(context, request); | 276 | OSHttpRequest req = new OSHttpRequest(context, request); |
277 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request)); | 277 | OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); |
278 | //resp.KeepAlive = req.KeepAlive; | 278 | //resp.KeepAlive = req.KeepAlive; |
279 | //m_log.Info("[Debug BASE HTTP SERVER]: Got Request"); | 279 | //m_log.Info("[Debug BASE HTTP SERVER]: Got Request"); |
280 | //HttpServerContextObj objstate= new HttpServerContextObj(req,resp); | 280 | //HttpServerContextObj objstate= new HttpServerContextObj(req,resp); |
@@ -444,6 +444,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
444 | try | 444 | try |
445 | { | 445 | { |
446 | response.Send(); | 446 | response.Send(); |
447 | response.FreeContext(); | ||
447 | } | 448 | } |
448 | catch (SocketException e) | 449 | catch (SocketException e) |
449 | { | 450 | { |
@@ -746,6 +747,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
746 | try | 747 | try |
747 | { | 748 | { |
748 | response.Send(); | 749 | response.Send(); |
750 | response.FreeContext(); | ||
749 | } | 751 | } |
750 | catch (SocketException e) | 752 | catch (SocketException e) |
751 | { | 753 | { |
@@ -778,6 +780,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
778 | try | 780 | try |
779 | { | 781 | { |
780 | response.Send(); | 782 | response.Send(); |
783 | response.FreeContext(); | ||
781 | } | 784 | } |
782 | catch (SocketException e) | 785 | catch (SocketException e) |
783 | { | 786 | { |
@@ -888,6 +891,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
888 | { | 891 | { |
889 | response.Send(); | 892 | response.Send(); |
890 | response.OutputStream.Flush(); | 893 | response.OutputStream.Flush(); |
894 | response.FreeContext(); | ||
891 | //response.OutputStream.Close(); | 895 | //response.OutputStream.Close(); |
892 | } | 896 | } |
893 | catch (IOException e) | 897 | catch (IOException e) |
@@ -1103,6 +1107,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1103 | try | 1107 | try |
1104 | { | 1108 | { |
1105 | response.Send(); | 1109 | response.Send(); |
1110 | response.FreeContext(); | ||
1106 | } | 1111 | } |
1107 | catch (SocketException f) | 1112 | catch (SocketException f) |
1108 | { | 1113 | { |
@@ -1377,7 +1382,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1377 | //response.OutputStream.Close(); | 1382 | //response.OutputStream.Close(); |
1378 | try | 1383 | try |
1379 | { | 1384 | { |
1385 | response.OutputStream.Flush(); | ||
1380 | response.Send(); | 1386 | response.Send(); |
1387 | |||
1388 | if (!response.KeepAlive) | ||
1389 | response.FreeContext(); | ||
1381 | } | 1390 | } |
1382 | catch (SocketException e) | 1391 | catch (SocketException e) |
1383 | { | 1392 | { |
@@ -1414,6 +1423,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1414 | try | 1423 | try |
1415 | { | 1424 | { |
1416 | response.Send(); | 1425 | response.Send(); |
1426 | response.FreeContext(); | ||
1417 | } | 1427 | } |
1418 | catch (SocketException e) | 1428 | catch (SocketException e) |
1419 | { | 1429 | { |
@@ -1449,6 +1459,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1449 | try | 1459 | try |
1450 | { | 1460 | { |
1451 | response.Send(); | 1461 | response.Send(); |
1462 | response.FreeContext(); | ||
1452 | } | 1463 | } |
1453 | catch (SocketException e) | 1464 | catch (SocketException e) |
1454 | { | 1465 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs index d299001..6c90a92 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs | |||
@@ -258,6 +258,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
258 | 258 | ||
259 | 259 | ||
260 | protected IHttpResponse _httpResponse; | 260 | protected IHttpResponse _httpResponse; |
261 | private IHttpClientContext _httpClientContext; | ||
261 | 262 | ||
262 | public OSHttpResponse() {} | 263 | public OSHttpResponse() {} |
263 | 264 | ||
@@ -275,6 +276,12 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
275 | public OSHttpResponse(OSHttpRequest req) | 276 | public OSHttpResponse(OSHttpRequest req) |
276 | { | 277 | { |
277 | _httpResponse = new HttpResponse(req.IHttpClientContext, req.IHttpRequest); | 278 | _httpResponse = new HttpResponse(req.IHttpClientContext, req.IHttpRequest); |
279 | _httpClientContext = req.IHttpClientContext; | ||
280 | } | ||
281 | public OSHttpResponse(HttpResponse resp, IHttpClientContext clientContext) | ||
282 | { | ||
283 | _httpResponse = resp; | ||
284 | _httpClientContext = clientContext; | ||
278 | } | 285 | } |
279 | 286 | ||
280 | /// <summary> | 287 | /// <summary> |
@@ -298,5 +305,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
298 | _httpResponse.Send(); | 305 | _httpResponse.Send(); |
299 | 306 | ||
300 | } | 307 | } |
308 | public void FreeContext() | ||
309 | { | ||
310 | if (_httpClientContext != null) | ||
311 | _httpClientContext.Close(); | ||
312 | } | ||
313 | |||
301 | } | 314 | } |
302 | } | 315 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 7f632cf..a9ee217 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
130 | foreach (object o in m_requests) | 130 | foreach (object o in m_requests) |
131 | { | 131 | { |
132 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; | 132 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; |
133 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request))); | 133 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); |
134 | } | 134 | } |
135 | 135 | ||
136 | m_requests.Clear(); | 136 | m_requests.Clear(); |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 4c0be78..24205eb 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
44 | private readonly BaseHttpServer m_server; | 44 | private readonly BaseHttpServer m_server; |
45 | private BlockingQueue<PollServiceHttpRequest> m_request; | 45 | private BlockingQueue<PollServiceHttpRequest> m_request; |
46 | private bool m_running = true; | 46 | private bool m_running = true; |
47 | private int m_timeout = 25000; | 47 | private int m_timeout = 250; |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
@@ -71,14 +71,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
71 | 71 | ||
72 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd()); | 72 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd()); |
73 | m_server.DoHTTPGruntWork(responsedata, | 73 | m_server.DoHTTPGruntWork(responsedata, |
74 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request))); | 74 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); |
75 | } | 75 | } |
76 | else | 76 | else |
77 | { | 77 | { |
78 | if ((Environment.TickCount - req.RequestTime) > m_timeout) | 78 | if ((Environment.TickCount - req.RequestTime) > m_timeout) |
79 | { | 79 | { |
80 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), | 80 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), |
81 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request))); | 81 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); |
82 | } | 82 | } |
83 | else | 83 | else |
84 | { | 84 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c956421..e532939 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1616,8 +1616,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1616 | agentData.child = false; | 1616 | agentData.child = false; |
1617 | agentData.firstname = m_firstName; | 1617 | agentData.firstname = m_firstName; |
1618 | agentData.lastname = m_lastName; | 1618 | agentData.lastname = m_lastName; |
1619 | 1619 | ||
1620 | ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>(); | 1620 | ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>(); |
1621 | |||
1622 | if (capsModule == null) // can happen when shutting down. | ||
1623 | return agentData; | ||
1624 | |||
1621 | agentData.CapsPath = capsModule.GetCapsPath(m_agentId); | 1625 | agentData.CapsPath = capsModule.GetCapsPath(m_agentId); |
1622 | agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId)); | 1626 | agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId)); |
1623 | 1627 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 81b47be..c064df1 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | |||
@@ -375,7 +375,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
375 | Hashtable responsedata = new Hashtable(); | 375 | Hashtable responsedata = new Hashtable(); |
376 | responsedata["int_response_code"] = 200; | 376 | responsedata["int_response_code"] = 200; |
377 | responsedata["content_type"] = "application/xml"; | 377 | responsedata["content_type"] = "application/xml"; |
378 | responsedata["keepalive"] = false; | 378 | responsedata["keepalive"] = true; |
379 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); | 379 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); |
380 | return responsedata; | 380 | return responsedata; |
381 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); | 381 | //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
386 | Hashtable responsedata = new Hashtable(); | 386 | Hashtable responsedata = new Hashtable(); |
387 | responsedata["int_response_code"] = 502; | 387 | responsedata["int_response_code"] = 502; |
388 | responsedata["content_type"] = "text/plain"; | 388 | responsedata["content_type"] = "text/plain"; |
389 | responsedata["keepalive"] = false; | 389 | responsedata["keepalive"] = true; |
390 | responsedata["str_response_string"] = "Upstream error: "; | 390 | responsedata["str_response_string"] = "Upstream error: "; |
391 | responsedata["error_status_text"] = "Upstream error:"; | 391 | responsedata["error_status_text"] = "Upstream error:"; |
392 | responsedata["http_protocol_version"] = "HTTP/1.0"; | 392 | responsedata["http_protocol_version"] = "HTTP/1.0"; |
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index 4775ec0..42b0d86 100644 --- a/bin/HttpServer_OpenSim.dll +++ b/bin/HttpServer_OpenSim.dll | |||
Binary files differ | |||
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb index b885eda..0c9e1f4 100644 --- a/bin/HttpServer_OpenSim.pdb +++ b/bin/HttpServer_OpenSim.pdb | |||
Binary files differ | |||