diff options
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
3 files changed, 39 insertions, 18 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7384e39..2582b7b 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -640,7 +640,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
640 | // Every month or so this will wrap and give bad numbers, not really a problem | 640 | // Every month or so this will wrap and give bad numbers, not really a problem |
641 | // since its just for reporting | 641 | // since its just for reporting |
642 | int tickdiff = requestEndTick - requestStartTick; | 642 | int tickdiff = requestEndTick - requestStartTick; |
643 | if (tickdiff > 3000) | 643 | if (tickdiff > 3000 && (requestHandler == null || requestHandler.Name == null || requestHandler.Name != "GetTexture")) |
644 | { | 644 | { |
645 | m_log.InfoFormat( | 645 | m_log.InfoFormat( |
646 | "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms", | 646 | "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms", |
@@ -1449,7 +1449,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1449 | internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1449 | internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1450 | { | 1450 | { |
1451 | int responsecode; | 1451 | int responsecode; |
1452 | string responseString; | 1452 | string responseString = String.Empty; |
1453 | byte[] responseData = null; | ||
1453 | string contentType; | 1454 | string contentType; |
1454 | 1455 | ||
1455 | if (responsedata == null) | 1456 | if (responsedata == null) |
@@ -1465,8 +1466,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1465 | { | 1466 | { |
1466 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1467 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); |
1467 | responsecode = (int)responsedata["int_response_code"]; | 1468 | responsecode = (int)responsedata["int_response_code"]; |
1468 | responseString = (string)responsedata["str_response_string"]; | 1469 | if (responsedata["bin_response_data"] != null) |
1470 | responseData = (byte[])responsedata["bin_response_data"]; | ||
1471 | else | ||
1472 | responseString = (string)responsedata["str_response_string"]; | ||
1469 | contentType = (string)responsedata["content_type"]; | 1473 | contentType = (string)responsedata["content_type"]; |
1474 | if (responseString == null) | ||
1475 | responseString = String.Empty; | ||
1470 | } | 1476 | } |
1471 | catch | 1477 | catch |
1472 | { | 1478 | { |
@@ -1520,25 +1526,40 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1520 | 1526 | ||
1521 | response.AddHeader("Content-Type", contentType); | 1527 | response.AddHeader("Content-Type", contentType); |
1522 | 1528 | ||
1529 | if (responsedata.ContainsKey("headers")) | ||
1530 | { | ||
1531 | Hashtable headerdata = (Hashtable)responsedata["headers"]; | ||
1532 | |||
1533 | foreach (string header in headerdata.Keys) | ||
1534 | response.AddHeader(header, (string)headerdata[header]); | ||
1535 | } | ||
1536 | |||
1523 | byte[] buffer; | 1537 | byte[] buffer; |
1524 | 1538 | ||
1525 | if (!(contentType.Contains("image") | 1539 | if (responseData != null) |
1526 | || contentType.Contains("x-shockwave-flash") | ||
1527 | || contentType.Contains("application/x-oar") | ||
1528 | || contentType.Contains("application/vnd.ll.mesh"))) | ||
1529 | { | 1540 | { |
1530 | // Text | 1541 | buffer = responseData; |
1531 | buffer = Encoding.UTF8.GetBytes(responseString); | ||
1532 | } | 1542 | } |
1533 | else | 1543 | else |
1534 | { | 1544 | { |
1535 | // Binary! | 1545 | if (!(contentType.Contains("image") |
1536 | buffer = Convert.FromBase64String(responseString); | 1546 | || contentType.Contains("x-shockwave-flash") |
1537 | } | 1547 | || contentType.Contains("application/x-oar") |
1548 | || contentType.Contains("application/vnd.ll.mesh"))) | ||
1549 | { | ||
1550 | // Text | ||
1551 | buffer = Encoding.UTF8.GetBytes(responseString); | ||
1552 | } | ||
1553 | else | ||
1554 | { | ||
1555 | // Binary! | ||
1556 | buffer = Convert.FromBase64String(responseString); | ||
1557 | } | ||
1538 | 1558 | ||
1539 | response.SendChunked = false; | 1559 | response.SendChunked = false; |
1540 | response.ContentLength64 = buffer.Length; | 1560 | response.ContentLength64 = buffer.Length; |
1541 | response.ContentEncoding = Encoding.UTF8; | 1561 | response.ContentEncoding = Encoding.UTF8; |
1562 | } | ||
1542 | 1563 | ||
1543 | return buffer; | 1564 | return buffer; |
1544 | } | 1565 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index c24a000..a80b1d7 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | |||
@@ -52,7 +52,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
52 | { | 52 | { |
53 | Normal = 0, | 53 | Normal = 0, |
54 | LslHttp = 1, | 54 | LslHttp = 1, |
55 | Inventory = 2 | 55 | Inventory = 2, |
56 | Texture = 3 | ||
56 | } | 57 | } |
57 | 58 | ||
58 | public PollServiceEventArgs( | 59 | public PollServiceEventArgs( |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index a1dee4e..db088e7 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -231,8 +231,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
231 | { | 231 | { |
232 | if (m_running) | 232 | if (m_running) |
233 | { | 233 | { |
234 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LslHttp || | 234 | if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.Normal) |
235 | req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Inventory) | ||
236 | { | 235 | { |
237 | m_requests.Enqueue(req); | 236 | m_requests.Enqueue(req); |
238 | } | 237 | } |