diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
7 files changed, 91 insertions, 34 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 4ab6908..bfd67c7 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 6863e0e..0fde42c 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -399,6 +399,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
399 | StreamReader reader = new StreamReader(requestStream, encoding); | 399 | StreamReader reader = new StreamReader(requestStream, encoding); |
400 | 400 | ||
401 | string requestBody = reader.ReadToEnd(); | 401 | string requestBody = reader.ReadToEnd(); |
402 | reader.Close(); | ||
402 | 403 | ||
403 | Hashtable keysvals = new Hashtable(); | 404 | Hashtable keysvals = new Hashtable(); |
404 | Hashtable headervals = new Hashtable(); | 405 | Hashtable headervals = new Hashtable(); |
@@ -738,7 +739,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
738 | // Every month or so this will wrap and give bad numbers, not really a problem | 739 | // Every month or so this will wrap and give bad numbers, not really a problem |
739 | // since its just for reporting | 740 | // since its just for reporting |
740 | int tickdiff = requestEndTick - requestStartTick; | 741 | int tickdiff = requestEndTick - requestStartTick; |
741 | if (tickdiff > 3000 && requestHandler != null && requestHandler.Name != "GetTexture") | 742 | if (tickdiff > 3000 && (requestHandler == null || requestHandler.Name == null || requestHandler.Name != "GetTexture")) |
742 | { | 743 | { |
743 | m_log.InfoFormat( | 744 | m_log.InfoFormat( |
744 | "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", | 745 | "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", |
@@ -1659,10 +1660,40 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1659 | 1660 | ||
1660 | internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1661 | internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1661 | { | 1662 | { |
1662 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1663 | int responsecode; |
1663 | int responsecode = (int)responsedata["int_response_code"]; | 1664 | string responseString = String.Empty; |
1664 | string responseString = (string)responsedata["str_response_string"]; | 1665 | byte[] responseData = null; |
1665 | string contentType = (string)responsedata["content_type"]; | 1666 | string contentType; |
1667 | |||
1668 | if (responsedata == null) | ||
1669 | { | ||
1670 | responsecode = 500; | ||
1671 | responseString = "No response could be obtained"; | ||
1672 | contentType = "text/plain"; | ||
1673 | responsedata = new Hashtable(); | ||
1674 | } | ||
1675 | else | ||
1676 | { | ||
1677 | try | ||
1678 | { | ||
1679 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | ||
1680 | responsecode = (int)responsedata["int_response_code"]; | ||
1681 | if (responsedata["bin_response_data"] != null) | ||
1682 | responseData = (byte[])responsedata["bin_response_data"]; | ||
1683 | else | ||
1684 | responseString = (string)responsedata["str_response_string"]; | ||
1685 | contentType = (string)responsedata["content_type"]; | ||
1686 | if (responseString == null) | ||
1687 | responseString = String.Empty; | ||
1688 | } | ||
1689 | catch | ||
1690 | { | ||
1691 | responsecode = 500; | ||
1692 | responseString = "No response could be obtained"; | ||
1693 | contentType = "text/plain"; | ||
1694 | responsedata = new Hashtable(); | ||
1695 | } | ||
1696 | } | ||
1666 | 1697 | ||
1667 | if (responsedata.ContainsKey("error_status_text")) | 1698 | if (responsedata.ContainsKey("error_status_text")) |
1668 | { | 1699 | { |
@@ -1707,25 +1738,40 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1707 | 1738 | ||
1708 | response.AddHeader("Content-Type", contentType); | 1739 | response.AddHeader("Content-Type", contentType); |
1709 | 1740 | ||
1741 | if (responsedata.ContainsKey("headers")) | ||
1742 | { | ||
1743 | Hashtable headerdata = (Hashtable)responsedata["headers"]; | ||
1744 | |||
1745 | foreach (string header in headerdata.Keys) | ||
1746 | response.AddHeader(header, (string)headerdata[header]); | ||
1747 | } | ||
1748 | |||
1710 | byte[] buffer; | 1749 | byte[] buffer; |
1711 | 1750 | ||
1712 | if (!(contentType.Contains("image") | 1751 | if (responseData != null) |
1713 | || contentType.Contains("x-shockwave-flash") | ||
1714 | || contentType.Contains("application/x-oar") | ||
1715 | || contentType.Contains("application/vnd.ll.mesh"))) | ||
1716 | { | 1752 | { |
1717 | // Text | 1753 | buffer = responseData; |
1718 | buffer = Encoding.UTF8.GetBytes(responseString); | ||
1719 | } | 1754 | } |
1720 | else | 1755 | else |
1721 | { | 1756 | { |
1722 | // Binary! | 1757 | if (!(contentType.Contains("image") |
1723 | buffer = Convert.FromBase64String(responseString); | 1758 | || contentType.Contains("x-shockwave-flash") |
1724 | } | 1759 | || contentType.Contains("application/x-oar") |
1760 | || contentType.Contains("application/vnd.ll.mesh"))) | ||
1761 | { | ||
1762 | // Text | ||
1763 | buffer = Encoding.UTF8.GetBytes(responseString); | ||
1764 | } | ||
1765 | else | ||
1766 | { | ||
1767 | // Binary! | ||
1768 | buffer = Convert.FromBase64String(responseString); | ||
1769 | } | ||
1725 | 1770 | ||
1726 | response.SendChunked = false; | 1771 | response.SendChunked = false; |
1727 | response.ContentLength64 = buffer.Length; | 1772 | response.ContentLength64 = buffer.Length; |
1728 | response.ContentEncoding = Encoding.UTF8; | 1773 | response.ContentEncoding = Encoding.UTF8; |
1774 | } | ||
1729 | 1775 | ||
1730 | return buffer; | 1776 | return buffer; |
1731 | } | 1777 | } |
@@ -1806,7 +1852,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1806 | m_httpListener2.Start(64); | 1852 | m_httpListener2.Start(64); |
1807 | 1853 | ||
1808 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events | 1854 | // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events |
1809 | m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); | 1855 | m_PollServiceManager = new PollServiceRequestManager(this, 4, 25000); |
1810 | m_PollServiceManager.Start(); | 1856 | m_PollServiceManager.Start(); |
1811 | HTTPDRunning = true; | 1857 | HTTPDRunning = true; |
1812 | 1858 | ||
@@ -1856,7 +1902,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1856 | 1902 | ||
1857 | public void httpServerException(object source, Exception exception) | 1903 | public void httpServerException(object source, Exception exception) |
1858 | { | 1904 | { |
1859 | m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception); | 1905 | if (source.ToString() == "HttpServer.HttpListener" && exception.ToString().StartsWith("Mono.Security.Protocol.Tls.TlsException")) |
1906 | return; | ||
1907 | m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); | ||
1860 | /* | 1908 | /* |
1861 | if (HTTPDRunning)// && NotSocketErrors > 5) | 1909 | if (HTTPDRunning)// && NotSocketErrors > 5) |
1862 | { | 1910 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 3079a7e..c19ac32 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 | Normal = 0, | 53 | Normal = 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 PollServiceEventArgs( | 60 | public PollServiceEventArgs( |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index aee3e3c..98789be 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -59,8 +59,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
59 | 59 | ||
60 | private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); | 60 | private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2); |
61 | 61 | ||
62 | // private int m_timeout = 1000; // increase timeout 250; now use the event one | ||
63 | |||
64 | public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) | 62 | public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) |
65 | { | 63 | { |
66 | m_server = pSrv; | 64 | m_server = pSrv; |
@@ -147,7 +145,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
147 | public void Stop() | 145 | public void Stop() |
148 | { | 146 | { |
149 | m_running = false; | 147 | m_running = false; |
150 | // m_timeout = -10000; // cause all to expire | ||
151 | Thread.Sleep(1000); // let the world move | 148 | Thread.Sleep(1000); // let the world move |
152 | 149 | ||
153 | foreach (Thread t in m_workerThreads) | 150 | foreach (Thread t in m_workerThreads) |
@@ -283,14 +280,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
283 | } | 280 | } |
284 | finally | 281 | finally |
285 | { | 282 | { |
286 | //response.OutputStream.Close(); | ||
287 | try | 283 | try |
288 | { | 284 | { |
289 | response.OutputStream.Flush(); | 285 | response.OutputStream.Flush(); |
290 | response.Send(); | 286 | response.Send(); |
291 | |||
292 | //if (!response.KeepAlive && response.ReuseContext) | ||
293 | // response.FreeContext(); | ||
294 | } | 287 | } |
295 | catch (Exception e) | 288 | catch (Exception e) |
296 | { | 289 | { |
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 029b848..eb8c9f8 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -619,7 +619,7 @@ namespace OpenSim.Framework.Servers | |||
619 | } | 619 | } |
620 | } | 620 | } |
621 | 621 | ||
622 | protected string GetVersionText() | 622 | public string GetVersionText() |
623 | { | 623 | { |
624 | return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion); | 624 | return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion); |
625 | } | 625 | } |
@@ -792,4 +792,4 @@ namespace OpenSim.Framework.Servers | |||
792 | /// </summary> | 792 | /// </summary> |
793 | protected virtual void ShutdownSpecific() {} | 793 | protected virtual void ShutdownSpecific() {} |
794 | } | 794 | } |
795 | } \ No newline at end of file | 795 | } |
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 80568e0..737c14d 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.7.6"; | 32 | private const string VERSION_NUMBER = "0.7.6CM"; |
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 | ||