diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/MultipartForm.cs | 29 | ||||
-rw-r--r-- | OpenSim/Framework/SLUtil.cs | 33 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/UntrustedWebRequest.cs | 33 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 29 |
6 files changed, 123 insertions, 14 deletions
diff --git a/OpenSim/Framework/MultipartForm.cs b/OpenSim/Framework/MultipartForm.cs index 8ba6d22..90c4007 100644 --- a/OpenSim/Framework/MultipartForm.cs +++ b/OpenSim/Framework/MultipartForm.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using 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 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Net; | 30 | using System.Net; |
4 | using System.IO; | 31 | using System.IO; |
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index 2fc5bdf..f6d6a7c 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using 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 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Reflection; | 30 | using System.Reflection; |
4 | using log4net; | 31 | using log4net; |
@@ -219,7 +246,7 @@ namespace OpenSim.Framework | |||
219 | /// Parse a notecard in Linden format to a string of ordinary text. | 246 | /// Parse a notecard in Linden format to a string of ordinary text. |
220 | /// </summary> | 247 | /// </summary> |
221 | /// <param name="rawInput"></param> | 248 | /// <param name="rawInput"></param> |
222 | /// <returns></returns> | 249 | /// <returns></returns> |
223 | public static string ParseNotecardToString(string rawInput) | 250 | public static string ParseNotecardToString(string rawInput) |
224 | { | 251 | { |
225 | string[] output = ParseNotecardToList(rawInput).ToArray(); | 252 | string[] output = ParseNotecardToList(rawInput).ToArray(); |
@@ -237,7 +264,7 @@ namespace OpenSim.Framework | |||
237 | /// <returns></returns> | 264 | /// <returns></returns> |
238 | public static List<string> ParseNotecardToList(string rawInput) | 265 | public static List<string> ParseNotecardToList(string rawInput) |
239 | { | 266 | { |
240 | string[] input = rawInput.Replace("\r", "").Split('\n'); | 267 | string[] input = rawInput.Replace("\r", "").Split('\n'); |
241 | int idx = 0; | 268 | int idx = 0; |
242 | int level = 0; | 269 | int level = 0; |
243 | List<string> output = new List<string>(); | 270 | List<string> output = new List<string>(); |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 214f936..9a6ef77 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -202,16 +202,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
202 | if (!m_pollHandlers.ContainsKey(methodName)) | 202 | if (!m_pollHandlers.ContainsKey(methodName)) |
203 | { | 203 | { |
204 | m_pollHandlers.Add(methodName,args); | 204 | m_pollHandlers.Add(methodName,args); |
205 | pollHandlerResult = true; | 205 | pollHandlerResult = true; |
206 | |||
207 | } | 206 | } |
208 | } | 207 | } |
209 | 208 | ||
210 | if (pollHandlerResult) | 209 | if (pollHandlerResult) |
211 | return AddHTTPHandler(methodName, handler); | 210 | return AddHTTPHandler(methodName, handler); |
212 | 211 | ||
213 | return false; | 212 | return false; |
214 | |||
215 | } | 213 | } |
216 | 214 | ||
217 | // Note that the agent string is provided simply to differentiate | 215 | // Note that the agent string is provided simply to differentiate |
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index d13408d..65b1eb5 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
47 | bool AddAgentHandler(string agent, IHttpAgentHandler handler); | 47 | bool AddAgentHandler(string agent, IHttpAgentHandler handler); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Add a handler for an HTTP request | 50 | /// Add a handler for an HTTP request. |
51 | /// </summary> | 51 | /// </summary> |
52 | /// | 52 | /// |
53 | /// This handler can actually be invoked either as | 53 | /// This handler can actually be invoked either as |
@@ -66,6 +66,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
66 | /// or | 66 | /// or |
67 | /// | 67 | /// |
68 | /// http://localhost:9000/object/ | 68 | /// http://localhost:9000/object/ |
69 | /// | ||
70 | /// In addition, the handler invoked by the HTTP server for any request is the one when best matches the request | ||
71 | /// URI. So if a handler for "/myapp/" is registered and a request for "/myapp/page" is received, then | ||
72 | /// the "/myapp/" handler is invoked if no "/myapp/page" handler exists. | ||
69 | /// | 73 | /// |
70 | /// <param name="methodName"></param> | 74 | /// <param name="methodName"></param> |
71 | /// <param name="handler"></param> | 75 | /// <param name="handler"></param> |
@@ -73,7 +77,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
73 | /// true if the handler was successfully registered, false if a handler with the same name already existed. | 77 | /// true if the handler was successfully registered, false if a handler with the same name already existed. |
74 | /// </returns> | 78 | /// </returns> |
75 | bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); | 79 | bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); |
76 | |||
77 | 80 | ||
78 | bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args); | 81 | bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args); |
79 | 82 | ||
diff --git a/OpenSim/Framework/UntrustedWebRequest.cs b/OpenSim/Framework/UntrustedWebRequest.cs index 1af7c41..e6411cc 100644 --- a/OpenSim/Framework/UntrustedWebRequest.cs +++ b/OpenSim/Framework/UntrustedWebRequest.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using 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 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.IO; | 30 | using System.IO; |
4 | using System.Net; | 31 | using System.Net; |
@@ -118,7 +145,7 @@ namespace OpenSim.Framework | |||
118 | /// <param name="allowLoopback">True to allow loopback addresses to be used</param> | 145 | /// <param name="allowLoopback">True to allow loopback addresses to be used</param> |
119 | /// <param name="uri">The URI to test for whether it should be allowed.</param> | 146 | /// <param name="uri">The URI to test for whether it should be allowed.</param> |
120 | /// <returns> | 147 | /// <returns> |
121 | /// <c>true</c> if [is URI allowable] [the specified URI]; otherwise, <c>false</c>. | 148 | /// <c>true</c> if [is URI allowable] [the specified URI]; otherwise, <c>false</c>. |
122 | /// </returns> | 149 | /// </returns> |
123 | private static bool IsUriAllowable(Uri uri, bool allowLoopback) | 150 | private static bool IsUriAllowable(Uri uri, bool allowLoopback) |
124 | { | 151 | { |
@@ -180,7 +207,7 @@ namespace OpenSim.Framework | |||
180 | /// </summary> | 207 | /// </summary> |
181 | /// <param name="ip">The ip address to check.</param> | 208 | /// <param name="ip">The ip address to check.</param> |
182 | /// <returns> | 209 | /// <returns> |
183 | /// <c>true</c> if this is a loopback IP address; <c>false</c> otherwise. | 210 | /// <c>true</c> if this is a loopback IP address; <c>false</c> otherwise. |
184 | /// </returns> | 211 | /// </returns> |
185 | private static bool IsIPv6Loopback(IPAddress ip) | 212 | private static bool IsIPv6Loopback(IPAddress ip) |
186 | { | 213 | { |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index d9782ff..16e44af 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using 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 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Collections.Specialized; | 30 | using System.Collections.Specialized; |
4 | using System.IO; | 31 | using System.IO; |