aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2011-05-08 20:20:40 +0100
committerMelanie2011-05-08 20:20:40 +0100
commit1be67914fab348115faa1fc9e9ecffbf7c303093 (patch)
tree7ad4917efae6aebeefa51fe03b1d1aac3e95efcb /OpenSim/Framework
parentEnable compressed (gzip) fatpack transfers. (diff)
parentMantis #5472 (diff)
downloadopensim-SC-1be67914fab348115faa1fc9e9ecffbf7c303093.zip
opensim-SC-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.gz
opensim-SC-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.bz2
opensim-SC-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
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 239ce3d..4c007d6 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -96,251 +96,6 @@ namespace OpenSim.Framework
96 96
97 } 97 }
98 98
99 [Serializable]
100 public class SimpleRegionInfo
101 {
102// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
103
104 /// <summary>
105 /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
106 /// </summary>
107 public uint HttpPort
108 {
109 get { return m_httpPort; }
110 set { m_httpPort = value; }
111 }
112 protected uint m_httpPort;
113
114 /// <summary>
115 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
116 /// </summary>
117 public string ServerURI
118 {
119 get {
120 if ( m_serverURI != string.Empty ) {
121 return m_serverURI;
122 } else {
123 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
124 }
125 }
126 set {
127 if ( value.EndsWith("/") ) {
128 m_serverURI = value;
129 } else {
130 m_serverURI = value + '/';
131 }
132 }
133 }
134 protected string m_serverURI;
135
136 public string RegionName
137 {
138 get { return m_regionName; }
139 set { m_regionName = value; }
140 }
141 protected string m_regionName = String.Empty;
142
143 protected bool Allow_Alternate_Ports;
144 public bool m_allow_alternate_ports;
145 protected string m_externalHostName;
146
147 protected IPEndPoint m_internalEndPoint;
148 protected uint? m_regionLocX;
149 protected uint? m_regionLocY;
150 protected uint m_remotingPort;
151 public UUID RegionID = UUID.Zero;
152 public string RemotingAddress;
153 public UUID ScopeID = UUID.Zero;
154
155 public SimpleRegionInfo()
156 {
157 m_serverURI = string.Empty;
158 }
159
160 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
161 {
162 m_regionLocX = regionLocX;
163 m_regionLocY = regionLocY;
164
165 m_internalEndPoint = internalEndPoint;
166 m_externalHostName = externalUri;
167 m_serverURI = string.Empty;
168 }
169
170 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
171 {
172 m_regionLocX = regionLocX;
173 m_regionLocY = regionLocY;
174
175 m_externalHostName = externalUri;
176
177 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
178 m_serverURI = string.Empty;
179 }
180
181 public SimpleRegionInfo(RegionInfo ConvertFrom)
182 {
183 m_regionName = ConvertFrom.RegionName;
184 m_regionLocX = ConvertFrom.RegionLocX;
185 m_regionLocY = ConvertFrom.RegionLocY;
186 m_internalEndPoint = ConvertFrom.InternalEndPoint;
187 m_externalHostName = ConvertFrom.ExternalHostName;
188 m_remotingPort = ConvertFrom.RemotingPort;
189 m_httpPort = ConvertFrom.HttpPort;
190 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
191 RemotingAddress = ConvertFrom.RemotingAddress;
192 RegionID = UUID.Zero;
193 ServerURI = ConvertFrom.ServerURI;
194 }
195
196 public uint RemotingPort
197 {
198 get { return m_remotingPort; }
199 set { m_remotingPort = value; }
200 }
201
202 /// <value>
203 /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
204 ///
205 /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
206 /// </value>
207 public IPEndPoint ExternalEndPoint
208 {
209 get
210 {
211 // Old one defaults to IPv6
212 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
213
214 IPAddress ia = null;
215 // If it is already an IP, don't resolve it - just return directly
216 if (IPAddress.TryParse(m_externalHostName, out ia))
217 return new IPEndPoint(ia, m_internalEndPoint.Port);
218
219 // Reset for next check
220 ia = null;
221 try
222 {
223 foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
224 {
225 if (ia == null)
226 ia = Adr;
227
228 if (Adr.AddressFamily == AddressFamily.InterNetwork)
229 {
230 ia = Adr;
231 break;
232 }
233 }
234 }
235 catch (SocketException e)
236 {
237 throw new Exception(
238 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
239 e + "' attached to this exception", e);
240 }
241
242 return new IPEndPoint(ia, m_internalEndPoint.Port);
243 }
244
245 set { m_externalHostName = value.ToString(); }
246 }
247
248 public string ExternalHostName
249 {
250 get { return m_externalHostName; }
251 set { m_externalHostName = value; }
252 }
253
254 public IPEndPoint InternalEndPoint
255 {
256 get { return m_internalEndPoint; }
257 set { m_internalEndPoint = value; }
258 }
259
260 public uint RegionLocX
261 {
262 get { return m_regionLocX.Value; }
263 set { m_regionLocX = value; }
264 }
265
266 public uint RegionLocY
267 {
268 get { return m_regionLocY.Value; }
269 set { m_regionLocY = value; }
270 }
271
272 public ulong RegionHandle
273 {
274 get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
275 }
276
277 public int getInternalEndPointPort()
278 {
279 return m_internalEndPoint.Port;
280 }
281
282 public Dictionary<string, object> ToKeyValuePairs()
283 {
284 Dictionary<string, object> kvp = new Dictionary<string, object>();
285 kvp["uuid"] = RegionID.ToString();
286 kvp["locX"] = RegionLocX.ToString();
287 kvp["locY"] = RegionLocY.ToString();
288 kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
289 kvp["external_port"] = ExternalEndPoint.Port.ToString();
290 kvp["external_host_name"] = ExternalHostName;
291 kvp["http_port"] = HttpPort.ToString();
292 kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
293 kvp["internal_port"] = InternalEndPoint.Port.ToString();
294 kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
295 kvp["server_uri"] = ServerURI;
296
297 return kvp;
298 }
299
300 public SimpleRegionInfo(Dictionary<string, object> kvp)
301 {
302 if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null))
303 {
304 int port = 0;
305 Int32.TryParse((string)kvp["external_port"], out port);
306 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port);
307 ExternalEndPoint = ep;
308 }
309 else
310 ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
311
312 if (kvp["external_host_name"] != null)
313 ExternalHostName = (string)kvp["external_host_name"];
314
315 if (kvp["http_port"] != null)
316 {
317 UInt32 port = 0;
318 UInt32.TryParse((string)kvp["http_port"], out port);
319 HttpPort = port;
320 }
321
322 if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null))
323 {
324 int port = 0;
325 Int32.TryParse((string)kvp["internal_port"], out port);
326 IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port);
327 InternalEndPoint = ep;
328 }
329 else
330 InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
331
332 if (kvp["alternate_ports"] != null)
333 {
334 bool alts = false;
335 Boolean.TryParse((string)kvp["alternate_ports"], out alts);
336 m_allow_alternate_ports = alts;
337 }
338
339 if (kvp["server_uri"] != null)
340 ServerURI = (string)kvp["server_uri"];
341 }
342 }
343
344 public class RegionInfo 99 public class RegionInfo
345 { 100 {
346 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 101 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;