aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs2
-rw-r--r--OpenSim/Framework/NetworkUtil.cs37
-rw-r--r--OpenSim/Framework/Servers/Tests/VersionInfoTests.cs29
-rw-r--r--OpenSim/Framework/Util.cs2
4 files changed, 62 insertions, 8 deletions
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 5a57a3c..7e682fc 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Console
83 83
84 m_DataEvent.WaitOne(); 84 m_DataEvent.WaitOne();
85 85
86 lock(m_InputData) 86 lock (m_InputData)
87 { 87 {
88 if (m_InputData.Count == 0) 88 if (m_InputData.Count == 0)
89 { 89 {
diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs
index 351020b..5fe343d 100644
--- a/OpenSim/Framework/NetworkUtil.cs
+++ b/OpenSim/Framework/NetworkUtil.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Net.Sockets; 30using System.Net.Sockets;
4using System.Net; 31using System.Net;
@@ -34,7 +61,7 @@ namespace OpenSim.Framework
34 61
35 public static IPAddress GetIPFor(IPAddress user, IPAddress simulator) 62 public static IPAddress GetIPFor(IPAddress user, IPAddress simulator)
36 { 63 {
37 if(m_disabled) 64 if (m_disabled)
38 return simulator; 65 return simulator;
39 66
40 // Check if we're accessing localhost. 67 // Check if we're accessing localhost.
@@ -97,7 +124,7 @@ namespace OpenSim.Framework
97 } 124 }
98 } 125 }
99 126
100 if(destination.AddressFamily != AddressFamily.InterNetwork) 127 if (destination.AddressFamily != AddressFamily.InterNetwork)
101 return null; 128 return null;
102 129
103 // Check if we're accessing localhost. 130 // Check if we're accessing localhost.
@@ -118,12 +145,12 @@ namespace OpenSim.Framework
118 byte[] localBytes = subnet.Key.GetAddressBytes(); 145 byte[] localBytes = subnet.Key.GetAddressBytes();
119 byte[] destBytes = destination.GetAddressBytes(); 146 byte[] destBytes = destination.GetAddressBytes();
120 147
121 if(subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length) 148 if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length)
122 return null; 149 return null;
123 150
124 bool valid = true; 151 bool valid = true;
125 152
126 for(int i=0;i<subnetBytes.Length;i++) 153 for (int i=0;i<subnetBytes.Length;i++)
127 { 154 {
128 if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i])) 155 if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i]))
129 { 156 {
diff --git a/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs b/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs
index 6745bac..3df56a5 100644
--- a/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs
+++ b/OpenSim/Framework/Servers/Tests/VersionInfoTests.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Text; 30using System.Text;
4using NUnit.Framework; 31using NUnit.Framework;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index a188267..bc4af3f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -550,7 +550,7 @@ namespace OpenSim.Framework
550 { 550 {
551 foreach (IPAddress host in hosts) 551 foreach (IPAddress host in hosts)
552 { 552 {
553 if(host.AddressFamily == AddressFamily.InterNetwork) 553 if (host.AddressFamily == AddressFamily.InterNetwork)
554 return host; 554 return host;
555 } 555 }
556 // Well all else failed... 556 // Well all else failed...