aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2011-05-08 20:23:06 +0100
committerMelanie2011-05-08 20:23:06 +0100
commitb451cc1ebb9e950bb93e790ab9e83aff30a47c61 (patch)
treec9fbe41be36cf791976f9e5afabd44f69b64e747 /OpenSim/Framework
parentEnable compressed (gzip) fatpack transfers. (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-b451cc1ebb9e950bb93e790ab9e83aff30a47c61.zip
opensim-SC-b451cc1ebb9e950bb93e790ab9e83aff30a47c61.tar.gz
opensim-SC-b451cc1ebb9e950bb93e790ab9e83aff30a47c61.tar.bz2
opensim-SC-b451cc1ebb9e950bb93e790ab9e83aff30a47c61.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs2
-rw-r--r--OpenSim/Framework/ConfigSettings.cs116
-rw-r--r--OpenSim/Framework/MainServer.cs5
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs15
-rw-r--r--OpenSim/Framework/PriorityQueue.cs2
-rw-r--r--OpenSim/Framework/RegionInfo.cs245
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs14
7 files changed, 44 insertions, 355 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 28fe3ba..710a57d 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -460,7 +460,7 @@ namespace OpenSim.Framework
460 { 460 {
461 info["state"] = OSD.FromString(AttachmentObjectStates[i++]); 461 info["state"] = OSD.FromString(AttachmentObjectStates[i++]);
462 } 462 }
463 catch (IndexOutOfRangeException e) 463 catch (IndexOutOfRangeException)
464 { 464 {
465 m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list."); 465 m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list.");
466 } 466 }
diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs
index be77341..50328d7 100644
--- a/OpenSim/Framework/ConfigSettings.cs
+++ b/OpenSim/Framework/ConfigSettings.cs
@@ -29,113 +29,13 @@ namespace OpenSim.Framework
29{ 29{
30 public class ConfigSettings 30 public class ConfigSettings
31 { 31 {
32 private string m_physicsEngine; 32 public string PhysicsEngine { get; set; }
33 33 public string MeshEngineName { get; set; }
34 public string PhysicsEngine 34 public bool See_into_region_from_neighbor { get; set; }
35 { 35 public string StorageDll { get; set; }
36 get { return m_physicsEngine; } 36 public string ClientstackDll { get; set; }
37 set { m_physicsEngine = value; } 37 public bool PhysicalPrim { get; set; }
38 } 38 public string LibrariesXMLFile { get; set; }
39 private string m_meshEngineName;
40
41 public string MeshEngineName
42 {
43 get { return m_meshEngineName; }
44 set { m_meshEngineName = value; }
45 }
46
47 private bool m_see_into_region_from_neighbor;
48
49 public bool See_into_region_from_neighbor
50 {
51 get { return m_see_into_region_from_neighbor; }
52 set { m_see_into_region_from_neighbor = value; }
53 }
54
55 private string m_storageDll;
56
57 public string StorageDll
58 {
59 get { return m_storageDll; }
60 set { m_storageDll = value; }
61 }
62
63 private string m_clientstackDll;
64
65 public string ClientstackDll
66 {
67 get { return m_clientstackDll; }
68 set { m_clientstackDll = value; }
69 }
70
71 private bool m_physicalPrim;
72
73 public bool PhysicalPrim
74 {
75 get { return m_physicalPrim; }
76 set { m_physicalPrim = value; }
77 }
78
79 private bool m_standaloneAuthenticate = false;
80
81 public bool StandaloneAuthenticate
82 {
83 get { return m_standaloneAuthenticate; }
84 set { m_standaloneAuthenticate = value; }
85 }
86
87 private string m_standaloneWelcomeMessage = null;
88
89 public string StandaloneWelcomeMessage
90 {
91 get { return m_standaloneWelcomeMessage; }
92 set { m_standaloneWelcomeMessage = value; }
93 }
94
95 private string m_standaloneInventoryPlugin;
96
97 public string StandaloneInventoryPlugin
98 {
99 get { return m_standaloneInventoryPlugin; }
100 set { m_standaloneInventoryPlugin = value; }
101 }
102
103 private string m_standaloneUserPlugin;
104
105 public string StandaloneUserPlugin
106 {
107 get { return m_standaloneUserPlugin; }
108 set { m_standaloneUserPlugin = value; }
109 }
110
111 private string m_standaloneInventorySource;
112
113 public string StandaloneInventorySource
114 {
115 get { return m_standaloneInventorySource; }
116 set { m_standaloneInventorySource = value; }
117 }
118
119 private string m_standaloneUserSource;
120
121 public string StandaloneUserSource
122 {
123 get { return m_standaloneUserSource; }
124 set { m_standaloneUserSource = value; }
125 }
126
127 protected string m_librariesXMLFile;
128 public string LibrariesXMLFile
129 {
130 get
131 {
132 return m_librariesXMLFile;
133 }
134 set
135 {
136 m_librariesXMLFile = value;
137 }
138 }
139 39
140 public const uint DefaultAssetServerHttpPort = 8003; 40 public const uint DefaultAssetServerHttpPort = 8003;
141 public const uint DefaultRegionHttpPort = 9000; 41 public const uint DefaultRegionHttpPort = 9000;
@@ -146,4 +46,4 @@ namespace OpenSim.Framework
146 public const uint DefaultGridServerHttpPort = 8003; 46 public const uint DefaultGridServerHttpPort = 8003;
147 public const uint DefaultInventoryServerHttpPort = 8003; 47 public const uint DefaultInventoryServerHttpPort = 8003;
148 } 48 }
149} 49} \ No newline at end of file
diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs
index 0515b16..a3e0a26 100644
--- a/OpenSim/Framework/MainServer.cs
+++ b/OpenSim/Framework/MainServer.cs
@@ -52,6 +52,11 @@ namespace OpenSim.Framework
52 return GetHttpServer(port,null); 52 return GetHttpServer(port,null);
53 } 53 }
54 54
55 public static void AddHttpServer(BaseHttpServer server)
56 {
57 m_Servers.Add(server.Port, server);
58 }
59
55 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) 60 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
56 { 61 {
57 if (port == 0) 62 if (port == 0)
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index b25f8b9..5bb4111 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -49,6 +49,12 @@ namespace OpenSim.Framework
49 public string HttpSSLCN = ""; 49 public string HttpSSLCN = "";
50 public uint httpSSLPort = 9001; 50 public uint httpSSLPort = 9001;
51 51
52 // "Out of band" managemnt https
53 public bool ssl_listener = false;
54 public uint https_port = 0;
55 public string cert_path = String.Empty;
56 public string cert_pass = String.Empty;
57
52 public string MessagingURL = String.Empty; 58 public string MessagingURL = String.Empty;
53 59
54 public NetworkServersInfo() 60 public NetworkServersInfo()
@@ -86,6 +92,15 @@ namespace OpenSim.Framework
86 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); 92 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
87 93
88 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty); 94 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty);
95
96 // "Out of band management https"
97 ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false);
98 if( ssl_listener)
99 {
100 cert_path = config.Configs["Network"].GetString("cert_path",String.Empty);
101 cert_pass = config.Configs["Network"].GetString("cert_pass",String.Empty);
102 https_port = (uint)config.Configs["Network"].GetInt("https_port", 0);
103 }
89 } 104 }
90 } 105 }
91} 106}
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs
index 3e6fdaa..e7a7f7f 100644
--- a/OpenSim/Framework/PriorityQueue.cs
+++ b/OpenSim/Framework/PriorityQueue.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework
38{ 38{
39 public class PriorityQueue 39 public class PriorityQueue
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 public delegate bool UpdatePriorityHandler(ref uint priority, ISceneEntity entity); 43 public delegate bool UpdatePriorityHandler(ref uint priority, ISceneEntity entity);
44 44
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index f05e2e6..17184d6 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -97,251 +97,6 @@ namespace OpenSim.Framework
97 97
98 } 98 }
99 99
100 [Serializable]
101 public class SimpleRegionInfo
102 {
103// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
104
105 /// <summary>
106 /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
107 /// </summary>
108 public uint HttpPort
109 {
110 get { return m_httpPort; }
111 set { m_httpPort = value; }
112 }
113 protected uint m_httpPort;
114
115 /// <summary>
116 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
117 /// </summary>
118 public string ServerURI
119 {
120 get {
121 if ( m_serverURI != string.Empty ) {
122 return m_serverURI;
123 } else {
124 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
125 }
126 }
127 set {
128 if ( value.EndsWith("/") ) {
129 m_serverURI = value;
130 } else {
131 m_serverURI = value + '/';
132 }
133 }
134 }
135 protected string m_serverURI;
136
137 public string RegionName
138 {
139 get { return m_regionName; }
140 set { m_regionName = value; }
141 }
142 protected string m_regionName = String.Empty;
143
144 protected bool Allow_Alternate_Ports;
145 public bool m_allow_alternate_ports;
146 protected string m_externalHostName;
147
148 protected IPEndPoint m_internalEndPoint;
149 protected uint? m_regionLocX;
150 protected uint? m_regionLocY;
151 protected uint m_remotingPort;
152 public UUID RegionID = UUID.Zero;
153 public string RemotingAddress;
154 public UUID ScopeID = UUID.Zero;
155
156 public SimpleRegionInfo()
157 {
158 m_serverURI = string.Empty;
159 }
160
161 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
162 {
163 m_regionLocX = regionLocX;
164 m_regionLocY = regionLocY;
165
166 m_internalEndPoint = internalEndPoint;
167 m_externalHostName = externalUri;
168 m_serverURI = string.Empty;
169 }
170
171 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
172 {
173 m_regionLocX = regionLocX;
174 m_regionLocY = regionLocY;
175
176 m_externalHostName = externalUri;
177
178 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
179 m_serverURI = string.Empty;
180 }
181
182 public SimpleRegionInfo(RegionInfo ConvertFrom)
183 {
184 m_regionName = ConvertFrom.RegionName;
185 m_regionLocX = ConvertFrom.RegionLocX;
186 m_regionLocY = ConvertFrom.RegionLocY;
187 m_internalEndPoint = ConvertFrom.InternalEndPoint;
188 m_externalHostName = ConvertFrom.ExternalHostName;
189 m_remotingPort = ConvertFrom.RemotingPort;
190 m_httpPort = ConvertFrom.HttpPort;
191 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
192 RemotingAddress = ConvertFrom.RemotingAddress;
193 RegionID = UUID.Zero;
194 ServerURI = ConvertFrom.ServerURI;
195 }
196
197 public uint RemotingPort
198 {
199 get { return m_remotingPort; }
200 set { m_remotingPort = value; }
201 }
202
203 /// <value>
204 /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
205 ///
206 /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
207 /// </value>
208 public IPEndPoint ExternalEndPoint
209 {
210 get
211 {
212 // Old one defaults to IPv6
213 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
214
215 IPAddress ia = null;
216 // If it is already an IP, don't resolve it - just return directly
217 if (IPAddress.TryParse(m_externalHostName, out ia))
218 return new IPEndPoint(ia, m_internalEndPoint.Port);
219
220 // Reset for next check
221 ia = null;
222 try
223 {
224 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
225 {
226 if (ia == null)
227 ia = Adr;
228
229 if (Adr.AddressFamily == AddressFamily.InterNetwork)
230 {
231 ia = Adr;
232 break;
233 }
234 }
235 }
236 catch (SocketException e)
237 {
238 throw new Exception(
239 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
240 e + "' attached to this exception", e);
241 }
242
243 return new IPEndPoint(ia, m_internalEndPoint.Port);
244 }
245
246 set { m_externalHostName = value.ToString(); }
247 }
248
249 public string ExternalHostName
250 {
251 get { return m_externalHostName; }
252 set { m_externalHostName = value; }
253 }
254
255 public IPEndPoint InternalEndPoint
256 {
257 get { return m_internalEndPoint; }
258 set { m_internalEndPoint = value; }
259 }
260
261 public uint RegionLocX
262 {
263 get { return m_regionLocX.Value; }
264 set { m_regionLocX = value; }
265 }
266
267 public uint RegionLocY
268 {
269 get { return m_regionLocY.Value; }
270 set { m_regionLocY = value; }
271 }
272
273 public ulong RegionHandle
274 {
275 get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
276 }
277
278 public int getInternalEndPointPort()
279 {
280 return m_internalEndPoint.Port;
281 }
282
283 public Dictionary<string, object> ToKeyValuePairs()
284 {
285 Dictionary<string, object> kvp = new Dictionary<string, object>();
286 kvp["uuid"] = RegionID.ToString();
287 kvp["locX"] = RegionLocX.ToString();
288 kvp["locY"] = RegionLocY.ToString();
289 kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
290 kvp["external_port"] = ExternalEndPoint.Port.ToString();
291 kvp["external_host_name"] = ExternalHostName;
292 kvp["http_port"] = HttpPort.ToString();
293 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
294 kvp["internal_port"] = InternalEndPoint.Port.ToString();
295 kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
296 kvp["server_uri"] = ServerURI;
297
298 return kvp;
299 }
300
301 public SimpleRegionInfo(Dictionary<string, object> kvp)
302 {
303 if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null))
304 {
305 int port = 0;
306 Int32.TryParse((string)kvp["external_port"], out port);
307 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port);
308 ExternalEndPoint = ep;
309 }
310 else
311 ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
312
313 if (kvp["external_host_name"] != null)
314 ExternalHostName = (string)kvp["external_host_name"];
315
316 if (kvp["http_port"] != null)
317 {
318 UInt32 port = 0;
319 UInt32.TryParse((string)kvp["http_port"], out port);
320 HttpPort = port;
321 }
322
323 if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null))
324 {
325 int port = 0;
326 Int32.TryParse((string)kvp["internal_port"], out port);
327 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port);
328 InternalEndPoint = ep;
329 }
330 else
331 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
332
333 if (kvp["alternate_ports"] != null)
334 {
335 bool alts = false;
336 Boolean.TryParse((string)kvp["alternate_ports"], out alts);
337 m_allow_alternate_ports = alts;
338 }
339
340 if (kvp["server_uri"] != null)
341 ServerURI = (string)kvp["server_uri"];
342 }
343 }
344
345 public class RegionInfo 100 public class RegionInfo
346 { 101 {
347 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 102 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ba89e21..598e5d1 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -32,6 +32,7 @@ using System.Collections.Specialized;
32using System.IO; 32using System.IO;
33using System.Net; 33using System.Net;
34using System.Net.Sockets; 34using System.Net.Sockets;
35using System.Security.Cryptography.X509Certificates;
35using System.Reflection; 36using System.Reflection;
36using System.Globalization; 37using System.Globalization;
37using System.Text; 38using System.Text;
@@ -72,6 +73,7 @@ namespace OpenSim.Framework.Servers.HttpServer
72 protected uint m_port; 73 protected uint m_port;
73 protected uint m_sslport; 74 protected uint m_sslport;
74 protected bool m_ssl; 75 protected bool m_ssl;
76 private X509Certificate2 m_cert;
75 protected bool m_firstcaps = true; 77 protected bool m_firstcaps = true;
76 protected string m_SSLCommonName = ""; 78 protected string m_SSLCommonName = "";
77 79
@@ -123,6 +125,14 @@ namespace OpenSim.Framework.Servers.HttpServer
123 } 125 }
124 } 126 }
125 127
128 public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl)
129 {
130 if (m_ssl)
131 {
132 m_cert = new X509Certificate2(CPath, CPass);
133 }
134 }
135
126 /// <summary> 136 /// <summary>
127 /// Add a stream handler to the http server. If the handler already exists, then nothing happens. 137 /// Add a stream handler to the http server. If the handler already exists, then nothing happens.
128 /// </summary> 138 /// </summary>
@@ -1683,6 +1693,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1683 try 1693 try
1684 { 1694 {
1685 //m_httpListener = new HttpListener(); 1695 //m_httpListener = new HttpListener();
1696
1686 NotSocketErrors = 0; 1697 NotSocketErrors = 0;
1687 if (!m_ssl) 1698 if (!m_ssl)
1688 { 1699 {
@@ -1702,6 +1713,9 @@ namespace OpenSim.Framework.Servers.HttpServer
1702 { 1713 {
1703 //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); 1714 //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/");
1704 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); 1715 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
1716 m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert);
1717 m_httpListener2.ExceptionThrown += httpServerException;
1718 m_httpListener2.LogWriter = httpserverlog;
1705 } 1719 }
1706 1720
1707 m_httpListener2.RequestReceived += OnRequest; 1721 m_httpListener2.RequestReceived += OnRequest;