diff options
author | BlueWall | 2011-12-07 07:52:24 -0500 |
---|---|---|
committer | BlueWall | 2011-12-07 07:52:24 -0500 |
commit | 6ec59ee892c03ede9c83b5a0916f7fcfa5bbff13 (patch) | |
tree | 6a71504761c3bfc1fedcf77d6c8467330e874fe1 | |
parent | Merge branch 'master' of /home/opensim/var/repo/opensim (diff) | |
parent | Stop accidentally setting up the UploadTexture caps handler with the same url... (diff) | |
download | opensim-SC_OLD-6ec59ee892c03ede9c83b5a0916f7fcfa5bbff13.zip opensim-SC_OLD-6ec59ee892c03ede9c83b5a0916f7fcfa5bbff13.tar.gz opensim-SC_OLD-6ec59ee892c03ede9c83b5a0916f7fcfa5bbff13.tar.bz2 opensim-SC_OLD-6ec59ee892c03ede9c83b5a0916f7fcfa5bbff13.tar.xz |
Merge branch 'master' of /home/opensim/var/repo/opensim
61 files changed, 821 insertions, 134 deletions
diff --git a/.nant/local.include b/.nant/local.include index 698af3f..94f510f 100644 --- a/.nant/local.include +++ b/.nant/local.include | |||
@@ -149,6 +149,11 @@ | |||
149 | </exec> | 149 | </exec> |
150 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" /> | 150 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" /> |
151 | 151 | ||
152 | <exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.capabilities.handlers.tests"> | ||
153 | <arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" /> | ||
154 | </exec> | ||
155 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" /> | ||
156 | |||
152 | <delete dir="%temp%"/> | 157 | <delete dir="%temp%"/> |
153 | 158 | ||
154 | </target> | 159 | </target> |
@@ -338,6 +343,11 @@ | |||
338 | <arg value="-xml=test-results/OpenSim.Data.Tests.dll-Results.xml" /> | 343 | <arg value="-xml=test-results/OpenSim.Data.Tests.dll-Results.xml" /> |
339 | </exec> | 344 | </exec> |
340 | 345 | ||
346 | <exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.capabilities.handlers.tests"> | ||
347 | <arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" /> | ||
348 | <arg value="-xml=test-results/OpenSim.Capabilities.Handlers.Tests.dll-Results.xml" /> | ||
349 | </exec> | ||
350 | |||
341 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" /> | 351 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" /> |
342 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" /> | 352 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" /> |
343 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" /> | 353 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" /> |
@@ -347,6 +357,7 @@ | |||
347 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" /> | 357 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" /> |
348 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" /> | 358 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" /> |
349 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" /> | 359 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" /> |
360 | <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" /> | ||
350 | 361 | ||
351 | </target> | 362 | </target> |
352 | <!-- <exec program="nunit-console.exe" failonerror="false" resultproperty="testresult.acceptancetestassembly"> --> | 363 | <!-- <exec program="nunit-console.exe" failonerror="false" resultproperty="testresult.acceptancetestassembly"> --> |
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs index dea166d..d99ba57 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
41 | { | 41 | { |
42 | #region GET methods | 42 | #region GET methods |
43 | public string GetHandler(string request, string path, string param, | 43 | public string GetHandler(string request, string path, string param, |
44 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 44 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
45 | { | 45 | { |
46 | // foreach (string h in httpRequest.Headers.AllKeys) | 46 | // foreach (string h in httpRequest.Headers.AllKeys) |
47 | // foreach (string v in httpRequest.Headers.GetValues(h)) | 47 | // foreach (string v in httpRequest.Headers.GetValues(h)) |
@@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | public string GetHandlerRegions(OSHttpResponse httpResponse) | 67 | public string GetHandlerRegions(IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); | 69 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); |
70 | 70 | ||
@@ -95,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
95 | return rxw.ToString(); | 95 | return rxw.ToString(); |
96 | } | 96 | } |
97 | 97 | ||
98 | public string GetHandlerRegion(OSHttpResponse httpResponse, string param) | 98 | public string GetHandlerRegion(IOSHttpResponse httpResponse, string param) |
99 | { | 99 | { |
100 | // be resilient and don't get confused by a terminating '/' | 100 | // be resilient and don't get confused by a terminating '/' |
101 | param = param.TrimEnd(new char[]{'/'}); | 101 | param = param.TrimEnd(new char[]{'/'}); |
@@ -180,7 +180,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
180 | } | 180 | } |
181 | #endregion GET methods | 181 | #endregion GET methods |
182 | 182 | ||
183 | protected string RegionTerrain(OSHttpResponse httpResponse, Scene scene) | 183 | protected string RegionTerrain(IOSHttpResponse httpResponse, Scene scene) |
184 | { | 184 | { |
185 | httpResponse.SendChunked = true; | 185 | httpResponse.SendChunked = true; |
186 | httpResponse.ContentType = "text/xml"; | 186 | httpResponse.ContentType = "text/xml"; |
@@ -190,7 +190,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
190 | // "GET", "terrain not implemented"); | 190 | // "GET", "terrain not implemented"); |
191 | } | 191 | } |
192 | 192 | ||
193 | protected string RegionStats(OSHttpResponse httpResponse, Scene scene) | 193 | protected string RegionStats(IOSHttpResponse httpResponse, Scene scene) |
194 | { | 194 | { |
195 | int users = scene.GetRootAgentCount(); | 195 | int users = scene.GetRootAgentCount(); |
196 | int objects = scene.Entities.Count - users; | 196 | int objects = scene.Entities.Count - users; |
@@ -213,7 +213,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
213 | return rxw.ToString(); | 213 | return rxw.ToString(); |
214 | } | 214 | } |
215 | 215 | ||
216 | protected string RegionPrims(OSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max) | 216 | protected string RegionPrims(IOSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max) |
217 | { | 217 | { |
218 | httpResponse.SendChunked = true; | 218 | httpResponse.SendChunked = true; |
219 | httpResponse.ContentType = "text/xml"; | 219 | httpResponse.ContentType = "text/xml"; |
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs index 279db4c..468faea 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
40 | { | 40 | { |
41 | #region GET methods | 41 | #region GET methods |
42 | public string GetRegionInfoHandler(string request, string path, string param, | 42 | public string GetRegionInfoHandler(string request, string path, string param, |
43 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 43 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
44 | { | 44 | { |
45 | // foreach (string h in httpRequest.Headers.AllKeys) | 45 | // foreach (string h in httpRequest.Headers.AllKeys) |
46 | // foreach (string v in httpRequest.Headers.GetValues(h)) | 46 | // foreach (string v in httpRequest.Headers.GetValues(h)) |
@@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | public string GetRegionInfoHandlerRegions(OSHttpResponse httpResponse) | 67 | public string GetRegionInfoHandlerRegions(IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); | 69 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); |
70 | 70 | ||
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs index e0318e5..f666f45 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
40 | #region POST methods | 40 | #region POST methods |
41 | 41 | ||
42 | public string PostHandler(string request, string path, string param, | 42 | public string PostHandler(string request, string path, string param, |
43 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 43 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
44 | { | 44 | { |
45 | // foreach (string h in httpRequest.Headers.AllKeys) | 45 | // foreach (string h in httpRequest.Headers.AllKeys) |
46 | // foreach (string v in httpRequest.Headers.GetValues(h)) | 46 | // foreach (string v in httpRequest.Headers.GetValues(h)) |
@@ -92,7 +92,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | public string CreateRegion(OSHttpRequest request, OSHttpResponse response) | 95 | public string CreateRegion(IOSHttpRequest request, IOSHttpResponse response) |
96 | { | 96 | { |
97 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); | 97 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); |
98 | 98 | ||
@@ -108,7 +108,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
108 | return rxw.ToString(); | 108 | return rxw.ToString(); |
109 | } | 109 | } |
110 | 110 | ||
111 | public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene) | 111 | public string LoadPrims(string requestBody, IOSHttpRequest request, IOSHttpResponse response, Scene scene) |
112 | { | 112 | { |
113 | IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>(); | 113 | IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>(); |
114 | if (serialiser != null) | 114 | if (serialiser != null) |
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs index ff1502a..eb16750 100644 --- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs +++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
328 | /// </summary> | 328 | /// </summary> |
329 | /// <param name="request">HTTP request header</param> | 329 | /// <param name="request">HTTP request header</param> |
330 | /// <returns>true when the HTTP request came from god.</returns> | 330 | /// <returns>true when the HTTP request came from god.</returns> |
331 | protected bool IsGod(OSHttpRequest request) | 331 | protected bool IsGod(IOSHttpRequest request) |
332 | { | 332 | { |
333 | string[] keys = request.Headers.GetValues("X-OpenSim-Godkey"); | 333 | string[] keys = request.Headers.GetValues("X-OpenSim-Godkey"); |
334 | if (null == keys) return false; | 334 | if (null == keys) return false; |
@@ -342,7 +342,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
342 | /// HTTP header is indeed the password on file for the avatar | 342 | /// HTTP header is indeed the password on file for the avatar |
343 | /// specified by the UUID | 343 | /// specified by the UUID |
344 | /// </summary> | 344 | /// </summary> |
345 | protected bool IsVerifiedUser(OSHttpRequest request, UUID uuid) | 345 | protected bool IsVerifiedUser(IOSHttpRequest request, UUID uuid) |
346 | { | 346 | { |
347 | // XXX under construction | 347 | // XXX under construction |
348 | return false; | 348 | return false; |
@@ -377,7 +377,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
377 | /// <param name="message">failure message</param> | 377 | /// <param name="message">failure message</param> |
378 | /// <remarks>This should probably set a return code as | 378 | /// <remarks>This should probably set a return code as |
379 | /// well. (?)</remarks> | 379 | /// well. (?)</remarks> |
380 | protected string Failure(OSHttpResponse response, OSHttpStatusCode status, | 380 | protected string Failure(IOSHttpResponse response, OSHttpStatusCode status, |
381 | string method, string format, params string[] msg) | 381 | string method, string format, params string[] msg) |
382 | { | 382 | { |
383 | string m = String.Format(format, msg); | 383 | string m = String.Format(format, msg); |
@@ -396,7 +396,7 @@ namespace OpenSim.ApplicationPlugins.Rest | |||
396 | /// <param name="e">exception causing the failure message</param> | 396 | /// <param name="e">exception causing the failure message</param> |
397 | /// <remarks>This should probably set a return code as | 397 | /// <remarks>This should probably set a return code as |
398 | /// well. (?)</remarks> | 398 | /// well. (?)</remarks> |
399 | public string Failure(OSHttpResponse response, OSHttpStatusCode status, | 399 | public string Failure(IOSHttpResponse response, OSHttpStatusCode status, |
400 | string method, Exception e) | 400 | string method, Exception e) |
401 | { | 401 | { |
402 | string m = String.Format("exception occurred: {0}", e.Message); | 402 | string m = String.Format("exception occurred: {0}", e.Message); |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 7ab30ce..ae95821 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Capabilities.Handlers | |||
64 | m_assetService = assService; | 64 | m_assetService = assService; |
65 | } | 65 | } |
66 | 66 | ||
67 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 67 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | // Try to parse the texture ID from the request URL | 69 | // Try to parse the texture ID from the request URL |
70 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 70 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
@@ -127,7 +127,7 @@ namespace OpenSim.Capabilities.Handlers | |||
127 | /// <param name="textureID"></param> | 127 | /// <param name="textureID"></param> |
128 | /// <param name="format"></param> | 128 | /// <param name="format"></param> |
129 | /// <returns>False for "caller try another codec"; true otherwise</returns> | 129 | /// <returns>False for "caller try another codec"; true otherwise</returns> |
130 | private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) | 130 | private bool FetchTexture(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID textureID, string format) |
131 | { | 131 | { |
132 | // m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); | 132 | // m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); |
133 | AssetBase texture; | 133 | AssetBase texture; |
@@ -211,7 +211,7 @@ namespace OpenSim.Capabilities.Handlers | |||
211 | return true; | 211 | return true; |
212 | } | 212 | } |
213 | 213 | ||
214 | private void WriteTextureData(OSHttpRequest request, OSHttpResponse response, AssetBase texture, string format) | 214 | private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format) |
215 | { | 215 | { |
216 | string range = request.Headers.GetOne("Range"); | 216 | string range = request.Headers.GetOne("Range"); |
217 | 217 | ||
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs new file mode 100644 index 0000000..fd152c3 --- /dev/null +++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs | |||
@@ -0,0 +1,63 @@ | |||
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; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using log4net; | ||
32 | using log4net.Config; | ||
33 | using NUnit.Framework; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Capabilities.Handlers; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Framework.Servers.HttpServer; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Tests.Common; | ||
40 | using OpenSim.Tests.Common.Mock; | ||
41 | |||
42 | namespace OpenSim.Capabilities.Handlers.GetTexture.Tests | ||
43 | { | ||
44 | [TestFixture] | ||
45 | public class GetTextureHandlerTests | ||
46 | { | ||
47 | [Test] | ||
48 | public void TestTextureNotFound() | ||
49 | { | ||
50 | TestHelpers.InMethod(); | ||
51 | |||
52 | // Overkill - we only really need the asset service, not a whole scene. | ||
53 | Scene scene = SceneHelpers.SetupScene(); | ||
54 | |||
55 | GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); | ||
56 | TestOSHttpRequest req = new TestOSHttpRequest(); | ||
57 | TestOSHttpResponse resp = new TestOSHttpResponse(); | ||
58 | req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); | ||
59 | handler.Handle(null, null, req, resp); | ||
60 | Assert.That(resp.StatusCode, Is.EqualTo((int)System.Net.HttpStatusCode.NotFound)); | ||
61 | } | ||
62 | } | ||
63 | } \ No newline at end of file | ||
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index b89fd6a..b7ca703 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | |||
@@ -73,12 +73,10 @@ namespace OpenSim.Capabilities.Handlers | |||
73 | /// <param name="httpResponse"></param> | 73 | /// <param name="httpResponse"></param> |
74 | /// <returns>The upload response if the request is successful, null otherwise.</returns> | 74 | /// <returns>The upload response if the request is successful, null otherwise.</returns> |
75 | public string UploadBakedTexture( | 75 | public string UploadBakedTexture( |
76 | string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 76 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
77 | { | 77 | { |
78 | try | 78 | try |
79 | { | 79 | { |
80 | // m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + m_regionName); | ||
81 | |||
82 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | 80 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; |
83 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 81 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
84 | 82 | ||
@@ -106,7 +104,7 @@ namespace OpenSim.Capabilities.Handlers | |||
106 | } | 104 | } |
107 | catch (Exception e) | 105 | catch (Exception e) |
108 | { | 106 | { |
109 | m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString()); | 107 | m_log.Error("[CAPS]: " + e.ToString()); |
110 | } | 108 | } |
111 | 109 | ||
112 | return null; | 110 | return null; |
@@ -132,8 +130,6 @@ namespace OpenSim.Capabilities.Handlers | |||
132 | 130 | ||
133 | class BakedTextureUploader | 131 | class BakedTextureUploader |
134 | { | 132 | { |
135 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
136 | |||
137 | public event Action<UUID, byte[]> OnUpLoad; | 133 | public event Action<UUID, byte[]> OnUpLoad; |
138 | 134 | ||
139 | private string uploaderPath = String.Empty; | 135 | private string uploaderPath = String.Empty; |
@@ -158,12 +154,10 @@ namespace OpenSim.Capabilities.Handlers | |||
158 | public string uploaderCaps(byte[] data, string path, string param) | 154 | public string uploaderCaps(byte[] data, string path, string param) |
159 | { | 155 | { |
160 | Action<UUID, byte[]> handlerUpLoad = OnUpLoad; | 156 | Action<UUID, byte[]> handlerUpLoad = OnUpLoad; |
161 | |||
162 | // Don't do this asynchronously, otherwise it's possible for the client to send set appearance information | ||
163 | // on another thread which might send out avatar updates before the asset has been put into the asset | ||
164 | // service. | ||
165 | if (handlerUpLoad != null) | 157 | if (handlerUpLoad != null) |
166 | handlerUpLoad(newAssetID, data); | 158 | { |
159 | Util.FireAndForget(delegate(object o) { handlerUpLoad(newAssetID, data); }); | ||
160 | } | ||
167 | 161 | ||
168 | string res = String.Empty; | 162 | string res = String.Empty; |
169 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 163 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
@@ -175,7 +169,7 @@ namespace OpenSim.Capabilities.Handlers | |||
175 | 169 | ||
176 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 170 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
177 | 171 | ||
178 | // m_log.DebugFormat("[BAKED TEXTURE UPLOADER]: baked texture upload completed for {0}", newAssetID); | 172 | // m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID); |
179 | 173 | ||
180 | return res; | 174 | return res; |
181 | } | 175 | } |
diff --git a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs index 2dade5b..a086c0e 100644 --- a/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/WebFetchInventoryDescendents/WebFetchInvDescHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Capabilities.Handlers | |||
57 | m_LibraryService = libService; | 57 | m_LibraryService = libService; |
58 | } | 58 | } |
59 | 59 | ||
60 | public string FetchInventoryDescendentsRequest(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | // lock (m_fetchLock) | 62 | // lock (m_fetchLock) |
63 | // { | 63 | // { |
diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs index 7aaa994..c7c1fc9 100644 --- a/OpenSim/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Capabilities/LLSDStreamHandler.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Capabilities | |||
45 | } | 45 | } |
46 | 46 | ||
47 | public override byte[] Handle(string path, Stream request, | 47 | public override byte[] Handle(string path, Stream request, |
48 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 48 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
49 | { | 49 | { |
50 | //Encoding encoding = Util.UTF8; | 50 | //Encoding encoding = Util.UTF8; |
51 | //StreamReader streamReader = new StreamReader(request, false); | 51 | //StreamReader streamReader = new StreamReader(request, false); |
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index db063f1..4c381d0 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -600,7 +600,7 @@ namespace OpenSim.Framework.Servers | |||
600 | 600 | ||
601 | } | 601 | } |
602 | 602 | ||
603 | public string StatReport(OSHttpRequest httpRequest) | 603 | public string StatReport(IOSHttpRequest httpRequest) |
604 | { | 604 | { |
605 | // If we catch a request for "callback", wrap the response in the value for jsonp | 605 | // If we catch a request for "callback", wrap the response in the value for jsonp |
606 | if (httpRequest.Query.ContainsKey("callback")) | 606 | if (httpRequest.Query.ContainsKey("callback")) |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs index 04943d1..f1cde74 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs | |||
@@ -32,7 +32,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
32 | public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler | 32 | public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler |
33 | { | 33 | { |
34 | public abstract byte[] Handle(string path, Stream request, | 34 | public abstract byte[] Handle(string path, Stream request, |
35 | OSHttpRequest httpRequest, OSHttpResponse httpResponse); | 35 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); |
36 | 36 | ||
37 | protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path) | 37 | protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path) |
38 | { | 38 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs index bae4e1b..1699233 100644 --- a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
36 | { | 36 | { |
37 | private BinaryMethod m_method; | 37 | private BinaryMethod m_method; |
38 | 38 | ||
39 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 39 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
40 | { | 40 | { |
41 | byte[] data = ReadFully(request); | 41 | byte[] data = ReadFully(request); |
42 | string param = GetParam(path); | 42 | string param = GetParam(path); |
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs new file mode 100644 index 0000000..caf0edd --- /dev/null +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpRequest.cs | |||
@@ -0,0 +1,59 @@ | |||
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; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Specialized; | ||
31 | using System.IO; | ||
32 | using System.Net; | ||
33 | using System.Text; | ||
34 | using System.Web; | ||
35 | |||
36 | namespace OpenSim.Framework.Servers.HttpServer | ||
37 | { | ||
38 | public interface IOSHttpRequest | ||
39 | { | ||
40 | string[] AcceptTypes { get; } | ||
41 | Encoding ContentEncoding { get; } | ||
42 | long ContentLength { get; } | ||
43 | long ContentLength64 { get; } | ||
44 | string ContentType { get; } | ||
45 | HttpCookieCollection Cookies { get; } | ||
46 | bool HasEntityBody { get; } | ||
47 | NameValueCollection Headers { get; } | ||
48 | string HttpMethod { get; } | ||
49 | Stream InputStream { get; } | ||
50 | bool IsSecured { get; } | ||
51 | bool KeepAlive { get; } | ||
52 | NameValueCollection QueryString { get; } | ||
53 | Hashtable Query { get; } | ||
54 | string RawUrl { get; } | ||
55 | IPEndPoint RemoteIPEndPoint { get; } | ||
56 | Uri Url { get; } | ||
57 | string UserAgent { get; } | ||
58 | } | ||
59 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs new file mode 100644 index 0000000..33a1663 --- /dev/null +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs | |||
@@ -0,0 +1,138 @@ | |||
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; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Specialized; | ||
31 | using System.IO; | ||
32 | using System.Net; | ||
33 | using System.Text; | ||
34 | using System.Web; | ||
35 | |||
36 | namespace OpenSim.Framework.Servers.HttpServer | ||
37 | { | ||
38 | public interface IOSHttpResponse | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Content type property. | ||
42 | /// </summary> | ||
43 | /// <remarks> | ||
44 | /// Setting this property will also set IsContentTypeSet to | ||
45 | /// true. | ||
46 | /// </remarks> | ||
47 | string ContentType { get; set; } | ||
48 | |||
49 | /// <summary> | ||
50 | /// Boolean property indicating whether the content type | ||
51 | /// property actively has been set. | ||
52 | /// </summary> | ||
53 | /// <remarks> | ||
54 | /// IsContentTypeSet will go away together with .NET base. | ||
55 | /// </remarks> | ||
56 | // public bool IsContentTypeSet | ||
57 | // { | ||
58 | // get { return _contentTypeSet; } | ||
59 | // } | ||
60 | // private bool _contentTypeSet; | ||
61 | |||
62 | /// <summary> | ||
63 | /// Length of the body content; 0 if there is no body. | ||
64 | /// </summary> | ||
65 | long ContentLength { get; set; } | ||
66 | |||
67 | /// <summary> | ||
68 | /// Alias for ContentLength. | ||
69 | /// </summary> | ||
70 | long ContentLength64 { get; set; } | ||
71 | |||
72 | /// <summary> | ||
73 | /// Encoding of the body content. | ||
74 | /// </summary> | ||
75 | Encoding ContentEncoding { get; set; } | ||
76 | |||
77 | bool KeepAlive { get; set; } | ||
78 | |||
79 | /// <summary> | ||
80 | /// Get or set the keep alive timeout property (default is | ||
81 | /// 20). Setting this to 0 also disables KeepAlive. Setting | ||
82 | /// this to something else but 0 also enable KeepAlive. | ||
83 | /// </summary> | ||
84 | int KeepAliveTimeout { get; set; } | ||
85 | |||
86 | /// <summary> | ||
87 | /// Return the output stream feeding the body. | ||
88 | /// </summary> | ||
89 | /// <remarks> | ||
90 | /// On its way out... | ||
91 | /// </remarks> | ||
92 | Stream OutputStream { get; } | ||
93 | |||
94 | string ProtocolVersion { get; set; } | ||
95 | |||
96 | /// <summary> | ||
97 | /// Return the output stream feeding the body. | ||
98 | /// </summary> | ||
99 | Stream Body { get; } | ||
100 | |||
101 | /// <summary> | ||
102 | /// Set a redirct location. | ||
103 | /// </summary> | ||
104 | string RedirectLocation { set; } | ||
105 | |||
106 | /// <summary> | ||
107 | /// Chunk transfers. | ||
108 | /// </summary> | ||
109 | bool SendChunked { get; set; } | ||
110 | |||
111 | /// <summary> | ||
112 | /// HTTP status code. | ||
113 | /// </summary> | ||
114 | int StatusCode { get; set; } | ||
115 | |||
116 | /// <summary> | ||
117 | /// HTTP status description. | ||
118 | /// </summary> | ||
119 | string StatusDescription { get; set; } | ||
120 | |||
121 | bool ReuseContext { get; set; } | ||
122 | |||
123 | /// <summary> | ||
124 | /// Add a header field and content to the response. | ||
125 | /// </summary> | ||
126 | /// <param name="key">string containing the header field | ||
127 | /// name</param> | ||
128 | /// <param name="value">string containing the header field | ||
129 | /// value</param> | ||
130 | void AddHeader(string key, string value); | ||
131 | |||
132 | /// <summary> | ||
133 | /// Send the response back to the remote client | ||
134 | /// </summary> | ||
135 | void Send(); | ||
136 | } | ||
137 | } | ||
138 | |||
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs index 2e1bc0b..a449c2d 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs | |||
@@ -45,13 +45,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
45 | public interface IStreamedRequestHandler : IRequestHandler | 45 | public interface IStreamedRequestHandler : IRequestHandler |
46 | { | 46 | { |
47 | // Handle request stream, return byte array | 47 | // Handle request stream, return byte array |
48 | byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse); | 48 | byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); |
49 | } | 49 | } |
50 | 50 | ||
51 | public interface IStreamHandler : IRequestHandler | 51 | public interface IStreamHandler : IRequestHandler |
52 | { | 52 | { |
53 | // Handle request stream, return byte array | 53 | // Handle request stream, return byte array |
54 | void Handle(string path, Stream request, Stream response, OSHttpRequest httpReqbuest, OSHttpResponse httpResponse); | 54 | void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse); |
55 | } | 55 | } |
56 | 56 | ||
57 | public interface IGenericHTTPHandler : IRequestHandler | 57 | public interface IGenericHTTPHandler : IRequestHandler |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index e354dfb..fc8daf3 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | |||
@@ -39,7 +39,7 @@ using log4net; | |||
39 | 39 | ||
40 | namespace OpenSim.Framework.Servers.HttpServer | 40 | namespace OpenSim.Framework.Servers.HttpServer |
41 | { | 41 | { |
42 | public class OSHttpRequest | 42 | public class OSHttpRequest : IOSHttpRequest |
43 | { | 43 | { |
44 | private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
@@ -174,7 +174,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
174 | } | 174 | } |
175 | private Dictionary<string, object> _whiteboard = new Dictionary<string, object>(); | 175 | private Dictionary<string, object> _whiteboard = new Dictionary<string, object>(); |
176 | 176 | ||
177 | |||
178 | public OSHttpRequest() {} | 177 | public OSHttpRequest() {} |
179 | 178 | ||
180 | public OSHttpRequest(IHttpClientContext context, IHttpRequest req) | 179 | public OSHttpRequest(IHttpClientContext context, IHttpRequest req) |
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs index 7029289..f9227ac 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
36 | /// OSHttpResponse is the OpenSim representation of an HTTP | 36 | /// OSHttpResponse is the OpenSim representation of an HTTP |
37 | /// response. | 37 | /// response. |
38 | /// </summary> | 38 | /// </summary> |
39 | public class OSHttpResponse | 39 | public class OSHttpResponse : IOSHttpResponse |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// Content type property. | 42 | /// Content type property. |
@@ -275,7 +275,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | |||
279 | protected IHttpResponse _httpResponse; | 278 | protected IHttpResponse _httpResponse; |
280 | private IHttpClientContext _httpClientContext; | 279 | private IHttpClientContext _httpClientContext; |
281 | 280 | ||
@@ -331,4 +330,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
331 | } | 330 | } |
332 | 331 | ||
333 | } | 332 | } |
334 | } | 333 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs index 3f2b265..a467a83 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
45 | } | 45 | } |
46 | 46 | ||
47 | public void Handle(string path, Stream request, Stream responseStream, | 47 | public void Handle(string path, Stream request, Stream responseStream, |
48 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 48 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
49 | { | 49 | { |
50 | TRequest deserial; | 50 | TRequest deserial; |
51 | using (XmlTextReader xmlReader = new XmlTextReader(request)) | 51 | using (XmlTextReader xmlReader = new XmlTextReader(request)) |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestMethod.cs b/OpenSim/Framework/Servers/HttpServer/RestMethod.cs index f97efbe..80bc7ef 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestMethod.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestMethod.cs | |||
@@ -28,5 +28,5 @@ | |||
28 | namespace OpenSim.Framework.Servers.HttpServer | 28 | namespace OpenSim.Framework.Servers.HttpServer |
29 | { | 29 | { |
30 | public delegate string RestMethod(string request, string path, string param, | 30 | public delegate string RestMethod(string request, string path, string param, |
31 | OSHttpRequest httpRequest, OSHttpResponse httpResponse); | 31 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); |
32 | } | 32 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index 7ebb462..19c03a8 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs | |||
@@ -211,7 +211,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
211 | } | 211 | } |
212 | 212 | ||
213 | public void Handle(string path, Stream request, Stream responseStream, | 213 | public void Handle(string path, Stream request, Stream responseStream, |
214 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 214 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
215 | { | 215 | { |
216 | RestSessionObject<TRequest> deserial = default(RestSessionObject<TRequest>); | 216 | RestSessionObject<TRequest> deserial = default(RestSessionObject<TRequest>); |
217 | bool fail = false; | 217 | bool fail = false; |
@@ -270,7 +270,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
270 | } | 270 | } |
271 | 271 | ||
272 | public void Handle(string path, Stream request, Stream responseStream, | 272 | public void Handle(string path, Stream request, Stream responseStream, |
273 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 273 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
274 | { | 274 | { |
275 | TRequest deserial = default(TRequest); | 275 | TRequest deserial = default(TRequest); |
276 | bool fail = false; | 276 | bool fail = false; |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs index 2d43cd4..d2c4002 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
39 | get { return m_restMethod; } | 39 | get { return m_restMethod; } |
40 | } | 40 | } |
41 | 41 | ||
42 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 42 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
43 | { | 43 | { |
44 | Encoding encoding = Encoding.UTF8; | 44 | Encoding encoding = Encoding.UTF8; |
45 | StreamReader streamReader = new StreamReader(request, encoding); | 45 | StreamReader streamReader = new StreamReader(request, encoding); |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0a78df2..bae44ee 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -718,7 +718,7 @@ namespace OpenSim | |||
718 | public class SimStatusHandler : IStreamedRequestHandler | 718 | public class SimStatusHandler : IStreamedRequestHandler |
719 | { | 719 | { |
720 | public byte[] Handle(string path, Stream request, | 720 | public byte[] Handle(string path, Stream request, |
721 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 721 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
722 | { | 722 | { |
723 | return Util.UTF8.GetBytes("OK"); | 723 | return Util.UTF8.GetBytes("OK"); |
724 | } | 724 | } |
@@ -755,7 +755,7 @@ namespace OpenSim | |||
755 | } | 755 | } |
756 | 756 | ||
757 | public byte[] Handle(string path, Stream request, | 757 | public byte[] Handle(string path, Stream request, |
758 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 758 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
759 | { | 759 | { |
760 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 760 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
761 | } | 761 | } |
@@ -796,7 +796,7 @@ namespace OpenSim | |||
796 | } | 796 | } |
797 | 797 | ||
798 | public byte[] Handle(string path, Stream request, | 798 | public byte[] Handle(string path, Stream request, |
799 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 799 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
800 | { | 800 | { |
801 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 801 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
802 | } | 802 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 98dda36..2347cf2 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -223,7 +223,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
223 | /// <param name="httpResponse">HTTP response header object</param> | 223 | /// <param name="httpResponse">HTTP response header object</param> |
224 | /// <returns></returns> | 224 | /// <returns></returns> |
225 | public string SeedCapRequest(string request, string path, string param, | 225 | public string SeedCapRequest(string request, string path, string param, |
226 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 226 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
227 | { | 227 | { |
228 | // m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); | 228 | // m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); |
229 | 229 | ||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
256 | /// <param name="httpResponse">HTTP response header object</param> | 256 | /// <param name="httpResponse">HTTP response header object</param> |
257 | /// <returns></returns> | 257 | /// <returns></returns> |
258 | public string ScriptTaskInventory(string request, string path, string param, | 258 | public string ScriptTaskInventory(string request, string path, string param, |
259 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 259 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
260 | { | 260 | { |
261 | try | 261 | try |
262 | { | 262 | { |
@@ -685,7 +685,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
685 | /// <param name="param"></param> | 685 | /// <param name="param"></param> |
686 | /// <returns></returns> | 686 | /// <returns></returns> |
687 | public string NoteCardAgentInventory(string request, string path, string param, | 687 | public string NoteCardAgentInventory(string request, string path, string param, |
688 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 688 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
689 | { | 689 | { |
690 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request); | 690 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request); |
691 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request); | 691 | //m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index e61815f..45d6071 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs | |||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
104 | "UploadBakedTexture", | 104 | "UploadBakedTexture", |
105 | new RestStreamHandler( | 105 | new RestStreamHandler( |
106 | "POST", | 106 | "POST", |
107 | "/CAPS/" + m_uploadBakedTexturePath, | 107 | "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, |
108 | new UploadBakedTextureHandler( | 108 | new UploadBakedTextureHandler( |
109 | caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); | 109 | caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); |
110 | } | 110 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 1b53a42..637beef 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -54,8 +54,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
54 | m_FriendsModule = fmodule; | 54 | m_FriendsModule = fmodule; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream requestData, | 57 | public override byte[] Handle( |
58 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 58 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | StreamReader sr = new StreamReader(requestData); | 60 | StreamReader sr = new StreamReader(requestData); |
61 | string body = sr.ReadToEnd(); | 61 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 2117827..94bba83 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1421,7 +1421,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1421 | caps.RegisterHandler("RemoteParcelRequest", | 1421 | caps.RegisterHandler("RemoteParcelRequest", |
1422 | new RestStreamHandler("POST", capsBase + remoteParcelRequestPath, | 1422 | new RestStreamHandler("POST", capsBase + remoteParcelRequestPath, |
1423 | delegate(string request, string path, string param, | 1423 | delegate(string request, string path, string param, |
1424 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 1424 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
1425 | { | 1425 | { |
1426 | return RemoteParcelRequest(request, path, param, agentID, caps); | 1426 | return RemoteParcelRequest(request, path, param, agentID, caps); |
1427 | })); | 1427 | })); |
@@ -1429,7 +1429,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1429 | caps.RegisterHandler("ParcelPropertiesUpdate", | 1429 | caps.RegisterHandler("ParcelPropertiesUpdate", |
1430 | new RestStreamHandler("POST", "/CAPS/" + parcelCapID, | 1430 | new RestStreamHandler("POST", "/CAPS/" + parcelCapID, |
1431 | delegate(string request, string path, string param, | 1431 | delegate(string request, string path, string param, |
1432 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 1432 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
1433 | { | 1433 | { |
1434 | return ProcessPropertiesUpdate(request, path, param, agentID, caps); | 1434 | return ProcessPropertiesUpdate(request, path, param, agentID, caps); |
1435 | })); | 1435 | })); |
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 898ca4a..5239f50 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -293,7 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
293 | /// <param name="httpResponse"></param> | 293 | /// <param name="httpResponse"></param> |
294 | /// <returns></returns> | 294 | /// <returns></returns> |
295 | protected string HandleObjectMediaMessage( | 295 | protected string HandleObjectMediaMessage( |
296 | string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 296 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
297 | { | 297 | { |
298 | // m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); | 298 | // m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); |
299 | 299 | ||
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
474 | /// <param name="httpResponse">/param> | 474 | /// <param name="httpResponse">/param> |
475 | /// <returns></returns> | 475 | /// <returns></returns> |
476 | protected string HandleObjectMediaNavigateMessage( | 476 | protected string HandleObjectMediaNavigateMessage( |
477 | string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 477 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
478 | { | 478 | { |
479 | // m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); | 479 | // m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); |
480 | 480 | ||
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 95c727f..9b0e2ff 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
193 | caps.RegisterHandler("MapLayer", | 193 | caps.RegisterHandler("MapLayer", |
194 | new RestStreamHandler("POST", capsBase + m_mapLayerPath, | 194 | new RestStreamHandler("POST", capsBase + m_mapLayerPath, |
195 | delegate(string request, string path, string param, | 195 | delegate(string request, string path, string param, |
196 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 196 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
197 | { | 197 | { |
198 | return MapLayerRequest(request, path, param, | 198 | return MapLayerRequest(request, path, param, |
199 | agentID, caps); | 199 | agentID, caps); |
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs index a505999..b760454 100644 --- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.DataSnapshot | |||
74 | } | 74 | } |
75 | 75 | ||
76 | public string OnDiscoveryAttempt(string request, string path, string param, | 76 | public string OnDiscoveryAttempt(string request, string path, string param, |
77 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 77 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
78 | { | 78 | { |
79 | //Very static for now, flexible enough to add new formats | 79 | //Very static for now, flexible enough to add new formats |
80 | LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse(); | 80 | LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse(); |
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index 4578236..6c5685c 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
64 | osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); | 64 | osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); |
65 | } | 65 | } |
66 | 66 | ||
67 | public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 67 | public byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | return Util.UTF8.GetBytes(Report()); | 69 | return Util.UTF8.GetBytes(Report()); |
70 | } | 70 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 28f04b3..89704d5 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs | |||
@@ -48,10 +48,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AppearanceInfoModule")] |
49 | public class AppearanceInfoModule : ISharedRegionModule | 49 | public class AppearanceInfoModule : ISharedRegionModule |
50 | { | 50 | { |
51 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | protected Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); | 53 | public const string SHOW_APPEARANCE_FORMAT = "{0,-9} {1}"; |
54 | protected IAvatarFactoryModule m_avatarFactory; | 54 | |
55 | private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); | ||
56 | private IAvatarFactoryModule m_avatarFactory; | ||
55 | 57 | ||
56 | public string Name { get { return "Appearance Information Module"; } } | 58 | public string Name { get { return "Appearance Information Module"; } } |
57 | 59 | ||
@@ -90,46 +92,154 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance | |||
90 | // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); | 92 | // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); |
91 | 93 | ||
92 | lock (m_scenes) | 94 | lock (m_scenes) |
93 | m_scenes[scene.RegionInfo.RegionID] = scene; | 95 | m_scenes[scene.RegionInfo.RegionID] = scene; |
96 | |||
97 | scene.AddCommand( | ||
98 | this, "show appearance", | ||
99 | "show appearance [<first-name> <last-name>]", | ||
100 | "Synonym for 'appearance show'", | ||
101 | HandleShowAppearanceCommand); | ||
94 | 102 | ||
95 | scene.AddCommand( | 103 | scene.AddCommand( |
96 | this, "appearance show", | 104 | this, "appearance show", |
97 | "appearance show", | 105 | "appearance show [<first-name> <last-name>]", |
98 | "Show appearance information for each avatar in the simulator.", | 106 | "Show appearance information for each avatar in the simulator.", |
99 | "At the moment this actually just checks that we have all the required baked textures. If not, then appearance is 'corrupt' and other avatars will continue to see a cloud.", | 107 | "This command checks whether the simulator has all the baked textures required to display an avatar to other viewers. " |
100 | ShowAppearanceInfo); | 108 | + "\nIf not, then appearance is 'corrupt' and other avatars will continue to see it as a cloud." |
109 | + "\nOptionally, you can view just a particular avatar's appearance information." | ||
110 | + "\nIn this case, the texture UUID for each bake type is also shown and whether the simulator can find the referenced texture.", | ||
111 | HandleShowAppearanceCommand); | ||
101 | 112 | ||
102 | scene.AddCommand( | 113 | scene.AddCommand( |
103 | this, "appearance send", | 114 | this, "appearance send", |
104 | "appearance send", | 115 | "appearance send [<first-name> <last-name>]", |
105 | "Send appearance data for each avatar in the simulator to viewers.", | 116 | "Send appearance data for each avatar in the simulator to other viewers.", |
106 | SendAppearance); | 117 | "Optionally, you can specify that only a particular avatar's appearance data is sent.", |
118 | HandleSendAppearanceCommand); | ||
107 | } | 119 | } |
108 | 120 | ||
109 | private void SendAppearance(string module, string[] cmd) | 121 | private void HandleSendAppearanceCommand(string module, string[] cmd) |
110 | { | 122 | { |
123 | if (cmd.Length != 2 && cmd.Length < 4) | ||
124 | { | ||
125 | MainConsole.Instance.OutputFormat("Usage: appearance send [<first-name> <last-name>]"); | ||
126 | return; | ||
127 | } | ||
128 | |||
129 | bool targetNameSupplied = false; | ||
130 | string optionalTargetFirstName = null; | ||
131 | string optionalTargetLastName = null; | ||
132 | |||
133 | if (cmd.Length >= 4) | ||
134 | { | ||
135 | targetNameSupplied = true; | ||
136 | optionalTargetFirstName = cmd[2]; | ||
137 | optionalTargetLastName = cmd[3]; | ||
138 | } | ||
139 | |||
111 | lock (m_scenes) | 140 | lock (m_scenes) |
112 | { | 141 | { |
113 | foreach (Scene scene in m_scenes.Values) | 142 | foreach (Scene scene in m_scenes.Values) |
114 | { | 143 | { |
115 | scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID)); | 144 | if (targetNameSupplied) |
145 | { | ||
146 | ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); | ||
147 | if (sp != null && !sp.IsChildAgent) | ||
148 | { | ||
149 | MainConsole.Instance.OutputFormat( | ||
150 | "Sending appearance information for {0} to all other avatars in {1}", | ||
151 | sp.Name, scene.RegionInfo.RegionName); | ||
152 | |||
153 | scene.AvatarFactory.SendAppearance(sp.UUID); | ||
154 | } | ||
155 | } | ||
156 | else | ||
157 | { | ||
158 | scene.ForEachRootScenePresence( | ||
159 | sp => | ||
160 | { | ||
161 | MainConsole.Instance.OutputFormat( | ||
162 | "Sending appearance information for {0} to all other avatars in {1}", | ||
163 | sp.Name, scene.RegionInfo.RegionName); | ||
164 | |||
165 | scene.AvatarFactory.SendAppearance(sp.UUID); | ||
166 | } | ||
167 | ); | ||
168 | } | ||
116 | } | 169 | } |
117 | } | 170 | } |
118 | } | 171 | } |
119 | 172 | ||
120 | protected void ShowAppearanceInfo(string module, string[] cmd) | 173 | protected void HandleShowAppearanceCommand(string module, string[] cmd) |
121 | { | 174 | { |
175 | if (cmd.Length != 2 && cmd.Length < 4) | ||
176 | { | ||
177 | MainConsole.Instance.OutputFormat("Usage: appearance show [<first-name> <last-name>]"); | ||
178 | return; | ||
179 | } | ||
180 | |||
181 | bool targetNameSupplied = false; | ||
182 | string optionalTargetFirstName = null; | ||
183 | string optionalTargetLastName = null; | ||
184 | |||
185 | if (cmd.Length >= 4) | ||
186 | { | ||
187 | targetNameSupplied = true; | ||
188 | optionalTargetFirstName = cmd[2]; | ||
189 | optionalTargetLastName = cmd[3]; | ||
190 | } | ||
191 | |||
122 | lock (m_scenes) | 192 | lock (m_scenes) |
123 | { | 193 | { |
124 | foreach (Scene scene in m_scenes.Values) | 194 | foreach (Scene scene in m_scenes.Values) |
125 | { | 195 | { |
126 | scene.ForEachRootScenePresence( | 196 | if (targetNameSupplied) |
127 | delegate(ScenePresence sp) | 197 | { |
198 | ScenePresence sp = scene.GetScenePresence(optionalTargetFirstName, optionalTargetLastName); | ||
199 | if (sp != null && !sp.IsChildAgent) | ||
128 | { | 200 | { |
201 | MainConsole.Instance.OutputFormat("For {0} in {1}", sp.Name, scene.RegionInfo.RegionName); | ||
202 | MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, "Bake Type", "UUID"); | ||
203 | |||
204 | Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures | ||
205 | = scene.AvatarFactory.GetBakedTextureFaces(sp.UUID); | ||
206 | foreach (BakeType bt in bakedTextures.Keys) | ||
207 | { | ||
208 | string rawTextureID; | ||
209 | |||
210 | if (bakedTextures[bt] == null) | ||
211 | { | ||
212 | rawTextureID = "not set"; | ||
213 | } | ||
214 | else | ||
215 | { | ||
216 | rawTextureID = bakedTextures[bt].TextureID.ToString(); | ||
217 | |||
218 | if (scene.AssetService.Get(rawTextureID) == null) | ||
219 | rawTextureID += " (not found)"; | ||
220 | else | ||
221 | rawTextureID += " (uploaded)"; | ||
222 | } | ||
223 | |||
224 | MainConsole.Instance.OutputFormat(SHOW_APPEARANCE_FORMAT, bt, rawTextureID); | ||
225 | } | ||
226 | |||
129 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | 227 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); |
130 | MainConsole.Instance.OutputFormat( | 228 | MainConsole.Instance.OutputFormat( |
131 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | 229 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); |
132 | }); | 230 | } |
231 | } | ||
232 | else | ||
233 | { | ||
234 | scene.ForEachRootScenePresence( | ||
235 | sp => | ||
236 | { | ||
237 | bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp); | ||
238 | MainConsole.Instance.OutputFormat( | ||
239 | "{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); | ||
240 | } | ||
241 | ); | ||
242 | } | ||
133 | } | 243 | } |
134 | } | 244 | } |
135 | } | 245 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index a5bba4f..5323a95 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
309 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 309 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
310 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, | 310 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, |
311 | delegate(string request, string path, string param, | 311 | delegate(string request, string path, string param, |
312 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 312 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
313 | { | 313 | { |
314 | return ProvisionVoiceAccountRequest(scene, request, path, param, | 314 | return ProvisionVoiceAccountRequest(scene, request, path, param, |
315 | agentID, caps); | 315 | agentID, caps); |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
317 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 317 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
318 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 318 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
319 | delegate(string request, string path, string param, | 319 | delegate(string request, string path, string param, |
320 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 320 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
321 | { | 321 | { |
322 | return ParcelVoiceInfoRequest(scene, request, path, param, | 322 | return ParcelVoiceInfoRequest(scene, request, path, param, |
323 | agentID, caps); | 323 | agentID, caps); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
325 | caps.RegisterHandler("ChatSessionRequest", | 325 | caps.RegisterHandler("ChatSessionRequest", |
326 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, | 326 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, |
327 | delegate(string request, string path, string param, | 327 | delegate(string request, string path, string param, |
328 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 328 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
329 | { | 329 | { |
330 | return ChatSessionRequest(scene, request, path, param, | 330 | return ChatSessionRequest(scene, request, path, param, |
331 | agentID, caps); | 331 | agentID, caps); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 534bf92..70e2f7e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -421,7 +421,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
421 | caps.RegisterHandler("ProvisionVoiceAccountRequest", | 421 | caps.RegisterHandler("ProvisionVoiceAccountRequest", |
422 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, | 422 | new RestStreamHandler("POST", capsBase + m_provisionVoiceAccountRequestPath, |
423 | delegate(string request, string path, string param, | 423 | delegate(string request, string path, string param, |
424 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 424 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
425 | { | 425 | { |
426 | return ProvisionVoiceAccountRequest(scene, request, path, param, | 426 | return ProvisionVoiceAccountRequest(scene, request, path, param, |
427 | agentID, caps); | 427 | agentID, caps); |
@@ -429,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
429 | caps.RegisterHandler("ParcelVoiceInfoRequest", | 429 | caps.RegisterHandler("ParcelVoiceInfoRequest", |
430 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, | 430 | new RestStreamHandler("POST", capsBase + m_parcelVoiceInfoRequestPath, |
431 | delegate(string request, string path, string param, | 431 | delegate(string request, string path, string param, |
432 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 432 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
433 | { | 433 | { |
434 | return ParcelVoiceInfoRequest(scene, request, path, param, | 434 | return ParcelVoiceInfoRequest(scene, request, path, param, |
435 | agentID, caps); | 435 | agentID, caps); |
@@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
437 | caps.RegisterHandler("ChatSessionRequest", | 437 | caps.RegisterHandler("ChatSessionRequest", |
438 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, | 438 | new RestStreamHandler("POST", capsBase + m_chatSessionRequestPath, |
439 | delegate(string request, string path, string param, | 439 | delegate(string request, string path, string param, |
440 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 440 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
441 | { | 441 | { |
442 | return ChatSessionRequest(scene, request, path, param, | 442 | return ChatSessionRequest(scene, request, path, param, |
443 | agentID, caps); | 443 | agentID, caps); |
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index f47d9c7..550b5d4 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
56 | } | 56 | } |
57 | 57 | ||
58 | public override byte[] Handle(string path, Stream requestData, | 58 | public override byte[] Handle(string path, Stream requestData, |
59 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | httpResponse.ContentType = "image/jpeg"; | 61 | httpResponse.ContentType = "image/jpeg"; |
62 | 62 | ||
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 0251ee8..fca9fd0 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs | |||
@@ -306,7 +306,7 @@ namespace OpenSim.Region.UserStatistics | |||
306 | caps.RegisterHandler("ViewerStats", | 306 | caps.RegisterHandler("ViewerStats", |
307 | new RestStreamHandler("POST", capsPath, | 307 | new RestStreamHandler("POST", capsPath, |
308 | delegate(string request, string path, string param, | 308 | delegate(string request, string path, string param, |
309 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 309 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
310 | { | 310 | { |
311 | return ViewerStatsReport(request, path, param, | 311 | return ViewerStatsReport(request, path, param, |
312 | agentID, caps); | 312 | agentID, caps); |
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index 8014fb5..0cfe5b1 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream request, | 59 | public override byte[] Handle(string path, Stream request, |
60 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | bool result = false; | 62 | bool result = false; |
63 | 63 | ||
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs index 43c1693..8f7412b 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | public override byte[] Handle(string path, Stream request, |
58 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | byte[] result = new byte[0]; | 60 | byte[] result = new byte[0]; |
61 | 61 | ||
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs index 1fcd3ed..87b3d2d 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | public override byte[] Handle(string path, Stream request, |
58 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); | 60 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); |
61 | AssetBase asset = (AssetBase) xs.Deserialize(request); | 61 | AssetBase asset = (AssetBase) xs.Deserialize(request); |
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 4d1b0ff..a19b599 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
71 | } | 71 | } |
72 | 72 | ||
73 | public override byte[] Handle(string path, Stream request, | 73 | public override byte[] Handle(string path, Stream request, |
74 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 74 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
75 | { | 75 | { |
76 | string[] p = SplitParams(path); | 76 | string[] p = SplitParams(path); |
77 | 77 | ||
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs index e73961b..440b898 100644 --- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs | |||
@@ -219,7 +219,7 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>. | |||
219 | /// Handles all GET and POST requests for OpenID identifier pages and endpoint | 219 | /// Handles all GET and POST requests for OpenID identifier pages and endpoint |
220 | /// server communication | 220 | /// server communication |
221 | /// </summary> | 221 | /// </summary> |
222 | public void Handle(string path, Stream request, Stream response, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 222 | public void Handle(string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
223 | { | 223 | { |
224 | Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath)); | 224 | Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath)); |
225 | 225 | ||
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs index d656238..bcf9d47 100644 --- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Server.Handlers.Authorization | |||
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | public override byte[] Handle(string path, Stream request, |
58 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest)); | 60 | XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest)); |
61 | AuthorizationRequest Authorization = (AuthorizationRequest) xs.Deserialize(request); | 61 | AuthorizationRequest Authorization = (AuthorizationRequest) xs.Deserialize(request); |
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 49c2e43..3ee405c 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | public override byte[] Handle(string path, Stream requestData, |
60 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
63 | string body = sr.ReadToEnd(); | 63 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Base/Utils.cs b/OpenSim/Server/Handlers/Base/Utils.cs index 92372a0..48d923f 100644 --- a/OpenSim/Server/Handlers/Base/Utils.cs +++ b/OpenSim/Server/Handlers/Base/Utils.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Base | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | public static bool GetAuthentication(OSHttpRequest httpRequest, out string authority, out string authKey) | 73 | public static bool GetAuthentication(IOSHttpRequest httpRequest, out string authority, out string authKey) |
74 | { | 74 | { |
75 | authority = string.Empty; | 75 | authority = string.Empty; |
76 | authKey = string.Empty; | 76 | authKey = string.Empty; |
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index fc97d8c..59420f5 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Friends | |||
58 | } | 58 | } |
59 | 59 | ||
60 | public override byte[] Handle(string path, Stream requestData, | 60 | public override byte[] Handle(string path, Stream requestData, |
61 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | StreamReader sr = new StreamReader(requestData); |
64 | string body = sr.ReadToEnd(); | 64 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index afe2f27..645a77f 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | |||
@@ -129,7 +129,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
129 | } | 129 | } |
130 | 130 | ||
131 | public string RestGetGridInfoMethod(string request, string path, string param, | 131 | public string RestGetGridInfoMethod(string request, string path, string param, |
132 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 132 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
133 | { | 133 | { |
134 | StringBuilder sb = new StringBuilder(); | 134 | StringBuilder sb = new StringBuilder(); |
135 | 135 | ||
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index edc0561..bebf482 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
58 | } | 58 | } |
59 | 59 | ||
60 | public override byte[] Handle(string path, Stream requestData, | 60 | public override byte[] Handle(string path, Stream requestData, |
61 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | StreamReader sr = new StreamReader(requestData); |
64 | string body = sr.ReadToEnd(); | 64 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 485bc3e..4c0d52e 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.GridUser | |||
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | public override byte[] Handle(string path, Stream requestData, |
60 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
63 | string body = sr.ReadToEnd(); | 63 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 56f130e..661507e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
61 | } | 61 | } |
62 | 62 | ||
63 | public override byte[] Handle(string path, Stream requestData, | 63 | public override byte[] Handle(string path, Stream requestData, |
64 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 64 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
65 | { | 65 | { |
66 | StreamReader sr = new StreamReader(requestData); | 66 | StreamReader sr = new StreamReader(requestData); |
67 | string body = sr.ReadToEnd(); | 67 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index 4accea1..f306b1c 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs | |||
@@ -63,12 +63,12 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
63 | } | 63 | } |
64 | 64 | ||
65 | public override byte[] Handle(string path, Stream requestData, | 65 | public override byte[] Handle(string path, Stream requestData, |
66 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 66 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
67 | { | 67 | { |
68 | return OKResponse(httpResponse); | 68 | return OKResponse(httpResponse); |
69 | } | 69 | } |
70 | 70 | ||
71 | private byte[] OKResponse(OSHttpResponse httpResponse) | 71 | private byte[] OKResponse(IOSHttpResponse httpResponse) |
72 | { | 72 | { |
73 | m_log.Debug("[HELO]: hi, GET was called"); | 73 | m_log.Debug("[HELO]: hi, GET was called"); |
74 | httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); | 74 | httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); |
@@ -92,12 +92,12 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
92 | } | 92 | } |
93 | 93 | ||
94 | public override byte[] Handle(string path, Stream requestData, | 94 | public override byte[] Handle(string path, Stream requestData, |
95 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 95 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
96 | { | 96 | { |
97 | return OKResponse(httpResponse); | 97 | return OKResponse(httpResponse); |
98 | } | 98 | } |
99 | 99 | ||
100 | private byte[] OKResponse(OSHttpResponse httpResponse) | 100 | private byte[] OKResponse(IOSHttpResponse httpResponse) |
101 | { | 101 | { |
102 | m_log.Debug("[HELO]: hi, HEAD was called"); | 102 | m_log.Debug("[HELO]: hi, HEAD was called"); |
103 | httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); | 103 | httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); |
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs index 850bf14..231e32f 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Inventory | |||
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream request, | 59 | public override byte[] Handle(string path, Stream request, |
60 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>)); | 62 | XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>)); |
63 | List<InventoryItemBase> items = (List<InventoryItemBase>)xs.Deserialize(request); | 63 | List<InventoryItemBase> items = (List<InventoryItemBase>)xs.Deserialize(request); |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 899f9c0..9d6f964 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
88 | } | 88 | } |
89 | 89 | ||
90 | public override byte[] Handle(string path, Stream requestData, | 90 | public override byte[] Handle(string path, Stream requestData, |
91 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 91 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
92 | { | 92 | { |
93 | StreamReader sr = new StreamReader(requestData); | 93 | StreamReader sr = new StreamReader(requestData); |
94 | string body = sr.ReadToEnd(); | 94 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index 8291107..75dd711 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
77 | m_MapService = service; | 77 | m_MapService = service; |
78 | } | 78 | } |
79 | 79 | ||
80 | public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 80 | public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
81 | { | 81 | { |
82 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); | 82 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); |
83 | StreamReader sr = new StreamReader(requestData); | 83 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index 501074d..fb85d1c 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
80 | m_MapService = service; | 80 | m_MapService = service; |
81 | } | 81 | } |
82 | 82 | ||
83 | public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 83 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
84 | { | 84 | { |
85 | byte[] result = new byte[0]; | 85 | byte[] result = new byte[0]; |
86 | 86 | ||
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs index 68bb01e..8a1f824 100644 --- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs +++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
59 | } | 59 | } |
60 | 60 | ||
61 | public override byte[] Handle(string path, Stream request, | 61 | public override byte[] Handle(string path, Stream request, |
62 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 62 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
63 | { | 63 | { |
64 | // Not implemented yet | 64 | // Not implemented yet |
65 | Console.WriteLine("--- Get region --- " + path); | 65 | Console.WriteLine("--- Get region --- " + path); |
@@ -84,7 +84,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
84 | } | 84 | } |
85 | 85 | ||
86 | public override byte[] Handle(string path, Stream request, | 86 | public override byte[] Handle(string path, Stream request, |
87 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 87 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
88 | { | 88 | { |
89 | byte[] result = new byte[0]; | 89 | byte[] result = new byte[0]; |
90 | 90 | ||
@@ -177,7 +177,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
177 | } | 177 | } |
178 | 178 | ||
179 | public override byte[] Handle(string path, Stream request, | 179 | public override byte[] Handle(string path, Stream request, |
180 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 180 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
181 | { | 181 | { |
182 | // Not implemented yet | 182 | // Not implemented yet |
183 | httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented; | 183 | httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented; |
@@ -198,7 +198,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
198 | } | 198 | } |
199 | 199 | ||
200 | public override byte[] Handle(string path, Stream request, | 200 | public override byte[] Handle(string path, Stream request, |
201 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 201 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
202 | { | 202 | { |
203 | // Not implemented yet | 203 | // Not implemented yet |
204 | httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented; | 204 | httpResponse.StatusCode = (int)HttpStatusCode.NotImplemented; |
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 85bf96e..6b6a552 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Presence | |||
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | public override byte[] Handle(string path, Stream requestData, |
60 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
63 | string body = sr.ReadToEnd(); | 63 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index fdb4967..1d1f9ef 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -249,7 +249,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
249 | } | 249 | } |
250 | 250 | ||
251 | public override byte[] Handle(string path, Stream request, | 251 | public override byte[] Handle(string path, Stream request, |
252 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 252 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
253 | { | 253 | { |
254 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); | 254 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); |
255 | 255 | ||
@@ -436,7 +436,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
436 | } | 436 | } |
437 | 437 | ||
438 | public override byte[] Handle(string path, Stream request, | 438 | public override byte[] Handle(string path, Stream request, |
439 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 439 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
440 | { | 440 | { |
441 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); | 441 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); |
442 | 442 | ||
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 5ab4caf..ab383ef 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Server.Handlers.UserAccounts | |||
69 | } | 69 | } |
70 | 70 | ||
71 | public override byte[] Handle(string path, Stream requestData, | 71 | public override byte[] Handle(string path, Stream requestData, |
72 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
73 | { | 73 | { |
74 | StreamReader sr = new StreamReader(requestData); | 74 | StreamReader sr = new StreamReader(requestData); |
75 | string body = sr.ReadToEnd(); | 75 | string body = sr.ReadToEnd(); |
diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs new file mode 100644 index 0000000..e769d30 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs | |||
@@ -0,0 +1,179 @@ | |||
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; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Collections.Specialized; | ||
32 | using System.IO; | ||
33 | using System.Net; | ||
34 | using System.Text; | ||
35 | using System.Web; | ||
36 | using OpenSim.Framework.Servers.HttpServer; | ||
37 | |||
38 | namespace OpenSim.Tests.Common.Mock | ||
39 | { | ||
40 | public class TestOSHttpRequest : IOSHttpRequest | ||
41 | { | ||
42 | public string[] AcceptTypes | ||
43 | { | ||
44 | get | ||
45 | { | ||
46 | throw new NotImplementedException (); | ||
47 | } | ||
48 | } | ||
49 | |||
50 | public Encoding ContentEncoding | ||
51 | { | ||
52 | get | ||
53 | { | ||
54 | throw new NotImplementedException (); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | public long ContentLength | ||
59 | { | ||
60 | get | ||
61 | { | ||
62 | throw new NotImplementedException (); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | public long ContentLength64 | ||
67 | { | ||
68 | get | ||
69 | { | ||
70 | throw new NotImplementedException (); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | public string ContentType | ||
75 | { | ||
76 | get | ||
77 | { | ||
78 | throw new NotImplementedException (); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | public HttpCookieCollection Cookies | ||
83 | { | ||
84 | get | ||
85 | { | ||
86 | throw new NotImplementedException (); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | public bool HasEntityBody | ||
91 | { | ||
92 | get | ||
93 | { | ||
94 | throw new NotImplementedException (); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public NameValueCollection Headers { get; set; } | ||
99 | |||
100 | public string HttpMethod | ||
101 | { | ||
102 | get | ||
103 | { | ||
104 | throw new NotImplementedException (); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | public Stream InputStream | ||
109 | { | ||
110 | get | ||
111 | { | ||
112 | throw new NotImplementedException (); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | public bool IsSecured | ||
117 | { | ||
118 | get | ||
119 | { | ||
120 | throw new NotImplementedException (); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | public bool KeepAlive | ||
125 | { | ||
126 | get | ||
127 | { | ||
128 | throw new NotImplementedException (); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | public NameValueCollection QueryString | ||
133 | { | ||
134 | get | ||
135 | { | ||
136 | throw new NotImplementedException (); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | public Hashtable Query | ||
141 | { | ||
142 | get | ||
143 | { | ||
144 | throw new NotImplementedException (); | ||
145 | } | ||
146 | } | ||
147 | |||
148 | public string RawUrl | ||
149 | { | ||
150 | get | ||
151 | { | ||
152 | throw new NotImplementedException (); | ||
153 | } | ||
154 | } | ||
155 | |||
156 | public IPEndPoint RemoteIPEndPoint | ||
157 | { | ||
158 | get | ||
159 | { | ||
160 | throw new NotImplementedException (); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | public Uri Url { get; set; } | ||
165 | |||
166 | public string UserAgent | ||
167 | { | ||
168 | get | ||
169 | { | ||
170 | throw new NotImplementedException (); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | public TestOSHttpRequest() | ||
175 | { | ||
176 | Headers = new NameValueCollection(); | ||
177 | } | ||
178 | } | ||
179 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index 581985a..e10fe82 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | |||
@@ -27,25 +27,107 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | ||
30 | using System.Text; | 31 | using System.Text; |
32 | using System.Web; | ||
31 | using OpenSim.Framework.Servers.HttpServer; | 33 | using OpenSim.Framework.Servers.HttpServer; |
32 | 34 | ||
33 | namespace OpenSim.Tests.Common.Mock | 35 | namespace OpenSim.Tests.Common.Mock |
34 | { | 36 | { |
35 | public class TestOSHttpResponse : OSHttpResponse | 37 | public class TestOSHttpResponse : IOSHttpResponse |
36 | { | 38 | { |
37 | private int m_statusCode; | 39 | /// <summary> |
38 | public override int StatusCode | 40 | /// Content type property. |
39 | { | 41 | /// </summary> |
40 | get { return m_statusCode; } | 42 | /// <remarks> |
41 | set { m_statusCode = value; } | 43 | /// Setting this property will also set IsContentTypeSet to |
42 | } | 44 | /// true. |
43 | 45 | /// </remarks> | |
44 | private string m_contentType; | 46 | public string ContentType { get; set; } |
45 | public override string ContentType | 47 | |
46 | { | 48 | /// <summary> |
47 | get { return m_contentType; } | 49 | /// Boolean property indicating whether the content type |
48 | set { m_contentType = value; } | 50 | /// property actively has been set. |
49 | } | 51 | /// </summary> |
52 | /// <remarks> | ||
53 | /// IsContentTypeSet will go away together with .NET base. | ||
54 | /// </remarks> | ||
55 | // public bool IsContentTypeSet | ||
56 | // { | ||
57 | // get { return _contentTypeSet; } | ||
58 | // } | ||
59 | // private bool _contentTypeSet; | ||
60 | |||
61 | /// <summary> | ||
62 | /// Length of the body content; 0 if there is no body. | ||
63 | /// </summary> | ||
64 | public long ContentLength { get; set; } | ||
65 | |||
66 | /// <summary> | ||
67 | /// Alias for ContentLength. | ||
68 | /// </summary> | ||
69 | public long ContentLength64 { get; set; } | ||
70 | |||
71 | /// <summary> | ||
72 | /// Encoding of the body content. | ||
73 | /// </summary> | ||
74 | public Encoding ContentEncoding { get; set; } | ||
75 | |||
76 | public bool KeepAlive { get; set; } | ||
77 | |||
78 | /// <summary> | ||
79 | /// Get or set the keep alive timeout property (default is | ||
80 | /// 20). Setting this to 0 also disables KeepAlive. Setting | ||
81 | /// this to something else but 0 also enable KeepAlive. | ||
82 | /// </summary> | ||
83 | public int KeepAliveTimeout { get; set; } | ||
84 | |||
85 | /// <summary> | ||
86 | /// Return the output stream feeding the body. | ||
87 | /// </summary> | ||
88 | /// <remarks> | ||
89 | /// On its way out... | ||
90 | /// </remarks> | ||
91 | public Stream OutputStream { get; private set; } | ||
92 | |||
93 | public string ProtocolVersion { get; set; } | ||
94 | |||
95 | /// <summary> | ||
96 | /// Return the output stream feeding the body. | ||
97 | /// </summary> | ||
98 | public Stream Body { get; private set; } | ||
99 | |||
100 | /// <summary> | ||
101 | /// Set a redirct location. | ||
102 | /// </summary> | ||
103 | public string RedirectLocation { private get; set; } | ||
104 | |||
105 | /// <summary> | ||
106 | /// Chunk transfers. | ||
107 | /// </summary> | ||
108 | public bool SendChunked { get; set; } | ||
109 | |||
110 | /// <summary> | ||
111 | /// HTTP status code. | ||
112 | /// </summary> | ||
113 | public int StatusCode { get; set; } | ||
114 | |||
115 | /// <summary> | ||
116 | /// HTTP status description. | ||
117 | /// </summary> | ||
118 | public string StatusDescription { get; set; } | ||
119 | |||
120 | public bool ReuseContext { get; set; } | ||
121 | |||
122 | /// <summary> | ||
123 | /// Add a header field and content to the response. | ||
124 | /// </summary> | ||
125 | /// <param name="key">string containing the header field | ||
126 | /// name</param> | ||
127 | /// <param name="value">string containing the header field | ||
128 | /// value</param> | ||
129 | public void AddHeader(string key, string value) { throw new NotImplementedException(); } | ||
130 | |||
131 | public void Send() { } | ||
50 | } | 132 | } |
51 | } | 133 | } \ No newline at end of file |
diff --git a/prebuild.xml b/prebuild.xml index 4e36172..e951187 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -2677,9 +2677,11 @@ | |||
2677 | <ReferencePath>../../../bin/</ReferencePath> | 2677 | <ReferencePath>../../../bin/</ReferencePath> |
2678 | <Reference name="System"/> | 2678 | <Reference name="System"/> |
2679 | <Reference name="System.Core"/> | 2679 | <Reference name="System.Core"/> |
2680 | <Reference name="System.Data"/> | ||
2680 | <Reference name="System.Drawing"/> | 2681 | <Reference name="System.Drawing"/> |
2681 | <Reference name="System.Xml"/> | 2682 | <Reference name="System.Xml"/> |
2682 | <Reference name="System.Data"/> | 2683 | <Reference name="System.Web"/> |
2684 | <Reference name="HttpServer_OpenSim" path="../../../bin/"/> | ||
2683 | <Reference name="log4net" path="../../../bin/"/> | 2685 | <Reference name="log4net" path="../../../bin/"/> |
2684 | <Reference name="Mono.Addins" path="../../../bin/"/> | 2686 | <Reference name="Mono.Addins" path="../../../bin/"/> |
2685 | <Reference name="Nini" path="../../../bin/"/> | 2687 | <Reference name="Nini" path="../../../bin/"/> |
@@ -2726,6 +2728,57 @@ | |||
2726 | </Files> | 2728 | </Files> |
2727 | </Project> | 2729 | </Project> |
2728 | 2730 | ||
2731 | |||
2732 | <Project frameworkVersion="v3_5" name="OpenSim.Capabilities.Handlers.Tests" path="OpenSim/Capabilities/Handlers" type="Library"> | ||
2733 | <Configuration name="Debug"> | ||
2734 | <Options> | ||
2735 | <OutputPath>../../../bin/</OutputPath> | ||
2736 | </Options> | ||
2737 | </Configuration> | ||
2738 | <Configuration name="Release"> | ||
2739 | <Options> | ||
2740 | <OutputPath>../../../bin/</OutputPath> | ||
2741 | </Options> | ||
2742 | </Configuration> | ||
2743 | |||
2744 | <ReferencePath>../../../bin/</ReferencePath> | ||
2745 | <Reference name="System"/> | ||
2746 | <Reference name="System.Core"/> | ||
2747 | <Reference name="System.Drawing"/> | ||
2748 | <Reference name="System.Xml"/> | ||
2749 | <Reference name="System.Web"/> | ||
2750 | <Reference name="nunit.framework" path="../../../bin/"/> | ||
2751 | <Reference name="OpenMetaverse" path="../../../bin/"/> | ||
2752 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> | ||
2753 | <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/> | ||
2754 | <Reference name="OpenSim.Capabilities"/> | ||
2755 | <Reference name="OpenSim.Capabilities.Handlers"/> | ||
2756 | <Reference name="OpenSim.Framework"/> | ||
2757 | <Reference name="OpenSim.Framework.Console"/> | ||
2758 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | ||
2759 | <Reference name="OpenSim.Region.Framework"/> | ||
2760 | <Reference name="OpenSim.Server.Base"/> | ||
2761 | <Reference name="OpenSim.Server.Handlers"/> | ||
2762 | <Reference name="OpenSim.Services.Base"/> | ||
2763 | <Reference name="OpenSim.Services.Interfaces"/> | ||
2764 | <Reference name="OpenSim.Tests.Common"/> | ||
2765 | <Reference name="Nini" path="../../../bin/"/> | ||
2766 | <Reference name="log4net" path="../../../bin/"/> | ||
2767 | <Reference name="DotNetOpenId" path="../../../bin/"/> | ||
2768 | |||
2769 | <!-- | ||
2770 | TODO: this is kind of lame, we basically build a duplicate | ||
2771 | assembly but with tests added in, just so that we don't | ||
2772 | need to hard code in a bunch of Test directories here. If | ||
2773 | pattern="Tests/*.cs" worked, we wouldn't need this. | ||
2774 | --> | ||
2775 | <Files> | ||
2776 | <!-- SADLY the way this works means you need to keep adding these paths --> | ||
2777 | <Match path="GetTexture/Tests" pattern="*.cs" recurse="true"/> | ||
2778 | </Files> | ||
2779 | </Project> | ||
2780 | |||
2781 | |||
2729 | <Project frameworkVersion="v3_5" name="OpenSim.Data.Tests" path="OpenSim/Data/Tests" type="Library"> | 2782 | <Project frameworkVersion="v3_5" name="OpenSim.Data.Tests" path="OpenSim/Data/Tests" type="Library"> |
2730 | <Configuration name="Debug"> | 2783 | <Configuration name="Debug"> |
2731 | <Options> | 2784 | <Options> |