aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs14
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs86
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs4
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs7
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs4
-rw-r--r--OpenSim/Framework/Servers/Tests/OSHttpTests.cs4
-rw-r--r--OpenSim/Framework/Servers/VersionInfo.cs6
7 files changed, 91 insertions, 34 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 035b3ad..6c04c69 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -133,7 +133,17 @@ namespace OpenSim.Framework.Servers
133 /// Performs initialisation of the scene, such as loading configuration from disk. 133 /// Performs initialisation of the scene, such as loading configuration from disk.
134 /// </summary> 134 /// </summary>
135 public virtual void Startup() 135 public virtual void Startup()
136 { 136 {
137 m_log.Info("[STARTUP]: Beginning startup processing");
138
139 m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine);
140 // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
141 // the clr version number doesn't match the project version number under Mono.
142 //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
143 m_log.InfoFormat(
144 "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
145 Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
146
137 StartupSpecific(); 147 StartupSpecific();
138 148
139 TimeSpan timeTaken = DateTime.Now - m_startuptime; 149 TimeSpan timeTaken = DateTime.Now - m_startuptime;
@@ -179,4 +189,4 @@ namespace OpenSim.Framework.Servers
179 } 189 }
180 } 190 }
181 } 191 }
182} \ No newline at end of file 192}
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 96a030b..d29cc61 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -395,6 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer
395 StreamReader reader = new StreamReader(requestStream, encoding); 395 StreamReader reader = new StreamReader(requestStream, encoding);
396 396
397 string requestBody = reader.ReadToEnd(); 397 string requestBody = reader.ReadToEnd();
398 reader.Close();
398 399
399 Hashtable keysvals = new Hashtable(); 400 Hashtable keysvals = new Hashtable();
400 Hashtable headervals = new Hashtable(); 401 Hashtable headervals = new Hashtable();
@@ -736,7 +737,7 @@ namespace OpenSim.Framework.Servers.HttpServer
736 // Every month or so this will wrap and give bad numbers, not really a problem 737 // Every month or so this will wrap and give bad numbers, not really a problem
737 // since its just for reporting 738 // since its just for reporting
738 int tickdiff = requestEndTick - requestStartTick; 739 int tickdiff = requestEndTick - requestStartTick;
739 if (tickdiff > 3000 && requestHandler != null && requestHandler.Name != "GetTexture") 740 if (tickdiff > 3000 && (requestHandler == null || requestHandler.Name == null || requestHandler.Name != "GetTexture"))
740 { 741 {
741 m_log.InfoFormat( 742 m_log.InfoFormat(
742 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", 743 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
@@ -1657,10 +1658,40 @@ namespace OpenSim.Framework.Servers.HttpServer
1657 1658
1658 internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) 1659 internal byte[] DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response)
1659 { 1660 {
1660 //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); 1661 int responsecode;
1661 int responsecode = (int)responsedata["int_response_code"]; 1662 string responseString = String.Empty;
1662 string responseString = (string)responsedata["str_response_string"]; 1663 byte[] responseData = null;
1663 string contentType = (string)responsedata["content_type"]; 1664 string contentType;
1665
1666 if (responsedata == null)
1667 {
1668 responsecode = 500;
1669 responseString = "No response could be obtained";
1670 contentType = "text/plain";
1671 responsedata = new Hashtable();
1672 }
1673 else
1674 {
1675 try
1676 {
1677 //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
1678 responsecode = (int)responsedata["int_response_code"];
1679 if (responsedata["bin_response_data"] != null)
1680 responseData = (byte[])responsedata["bin_response_data"];
1681 else
1682 responseString = (string)responsedata["str_response_string"];
1683 contentType = (string)responsedata["content_type"];
1684 if (responseString == null)
1685 responseString = String.Empty;
1686 }
1687 catch
1688 {
1689 responsecode = 500;
1690 responseString = "No response could be obtained";
1691 contentType = "text/plain";
1692 responsedata = new Hashtable();
1693 }
1694 }
1664 1695
1665 if (responsedata.ContainsKey("error_status_text")) 1696 if (responsedata.ContainsKey("error_status_text"))
1666 { 1697 {
@@ -1705,25 +1736,40 @@ namespace OpenSim.Framework.Servers.HttpServer
1705 1736
1706 response.AddHeader("Content-Type", contentType); 1737 response.AddHeader("Content-Type", contentType);
1707 1738
1739 if (responsedata.ContainsKey("headers"))
1740 {
1741 Hashtable headerdata = (Hashtable)responsedata["headers"];
1742
1743 foreach (string header in headerdata.Keys)
1744 response.AddHeader(header, (string)headerdata[header]);
1745 }
1746
1708 byte[] buffer; 1747 byte[] buffer;
1709 1748
1710 if (!(contentType.Contains("image") 1749 if (responseData != null)
1711 || contentType.Contains("x-shockwave-flash")
1712 || contentType.Contains("application/x-oar")
1713 || contentType.Contains("application/vnd.ll.mesh")))
1714 { 1750 {
1715 // Text 1751 buffer = responseData;
1716 buffer = Encoding.UTF8.GetBytes(responseString);
1717 } 1752 }
1718 else 1753 else
1719 { 1754 {
1720 // Binary! 1755 if (!(contentType.Contains("image")
1721 buffer = Convert.FromBase64String(responseString); 1756 || contentType.Contains("x-shockwave-flash")
1722 } 1757 || contentType.Contains("application/x-oar")
1758 || contentType.Contains("application/vnd.ll.mesh")))
1759 {
1760 // Text
1761 buffer = Encoding.UTF8.GetBytes(responseString);
1762 }
1763 else
1764 {
1765 // Binary!
1766 buffer = Convert.FromBase64String(responseString);
1767 }
1723 1768
1724 response.SendChunked = false; 1769 response.SendChunked = false;
1725 response.ContentLength64 = buffer.Length; 1770 response.ContentLength64 = buffer.Length;
1726 response.ContentEncoding = Encoding.UTF8; 1771 response.ContentEncoding = Encoding.UTF8;
1772 }
1727 1773
1728 return buffer; 1774 return buffer;
1729 } 1775 }
@@ -1804,7 +1850,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1804 m_httpListener2.Start(64); 1850 m_httpListener2.Start(64);
1805 1851
1806 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events 1852 // Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
1807 m_PollServiceManager = new PollServiceRequestManager(this, 3, 25000); 1853 m_PollServiceManager = new PollServiceRequestManager(this, 4, 25000);
1808 m_PollServiceManager.Start(); 1854 m_PollServiceManager.Start();
1809 HTTPDRunning = true; 1855 HTTPDRunning = true;
1810 1856
@@ -1839,7 +1885,9 @@ namespace OpenSim.Framework.Servers.HttpServer
1839 1885
1840 public void httpServerException(object source, Exception exception) 1886 public void httpServerException(object source, Exception exception)
1841 { 1887 {
1842 m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception); 1888 if (source.ToString() == "HttpServer.HttpListener" && exception.ToString().StartsWith("Mono.Security.Protocol.Tls.TlsException"))
1889 return;
1890 m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
1843 /* 1891 /*
1844 if (HTTPDRunning)// && NotSocketErrors > 5) 1892 if (HTTPDRunning)// && NotSocketErrors > 5)
1845 { 1893 {
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 2c4a687..b9e3c18 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -598,7 +598,7 @@ namespace OpenSim.Framework.Servers
598 } 598 }
599 } 599 }
600 600
601 protected string GetVersionText() 601 public string GetVersionText()
602 { 602 {
603 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion); 603 return String.Format("Version: {0} (interface version {1})", m_version, VersionInfo.MajorInterfaceVersion);
604 } 604 }
@@ -699,4 +699,4 @@ namespace OpenSim.Framework.Servers
699 m_console.OutputFormat(format, components); 699 m_console.OutputFormat(format, components);
700 } 700 }
701 } 701 }
702} \ No newline at end of file 702}
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