aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Asset
diff options
context:
space:
mode:
authoronefang2019-09-11 16:36:50 +1000
committeronefang2019-09-11 16:36:50 +1000
commit50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch)
tree52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Server/Handlers/Asset
parentRenamed branch to SledjChisl. (diff)
parentBump to release flavour, build 0. (diff)
downloadopensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2
opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz
Merge branch 'SledjChisl'
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs14
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs4
-rw-r--r--OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs12
3 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index ab81dd6..bad3ea2 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -151,27 +151,27 @@ namespace OpenSim.Server.Handlers.Asset
151 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId); 151 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId);
152 return; 152 return;
153 } 153 }
154 154
155 AssetBase asset = m_AssetService.Get(assetId.ToString()); 155 AssetBase asset = m_AssetService.Get(assetId.ToString());
156 if (asset == null) 156 if (asset == null)
157 { 157 {
158 MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId); 158 MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId);
159 return; 159 return;
160 } 160 }
161 161
162 string fileName = rawAssetId; 162 string fileName = rawAssetId;
163 163
164 if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, fileName)) 164 if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, fileName))
165 return; 165 return;
166 166
167 using (FileStream fs = new FileStream(fileName, FileMode.CreateNew)) 167 using (FileStream fs = new FileStream(fileName, FileMode.CreateNew))
168 { 168 {
169 using (BinaryWriter bw = new BinaryWriter(fs)) 169 using (BinaryWriter bw = new BinaryWriter(fs))
170 { 170 {
171 bw.Write(asset.Data); 171 bw.Write(asset.Data);
172 } 172 }
173 } 173 }
174 174
175 MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName); 175 MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
176 } 176 }
177 177
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index 91c5c54..8bfc690 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Server.Handlers.Asset
53 public AssetServerGetHandler(IAssetService service) : 53 public AssetServerGetHandler(IAssetService service) :
54 base("GET", "/assets") 54 base("GET", "/assets")
55 { 55 {
56 m_AssetService = service; 56 m_AssetService = service;
57 } 57 }
58 58
59 public AssetServerGetHandler(IAssetService service, IServiceAuth auth, string redirectURL) : 59 public AssetServerGetHandler(IAssetService service, IServiceAuth auth, string redirectURL) :
@@ -155,7 +155,7 @@ namespace OpenSim.Server.Handlers.Asset
155 httpResponse.ContentType = "text/plain"; 155 httpResponse.ContentType = "text/plain";
156 result = new byte[0]; 156 result = new byte[0];
157 } 157 }
158 158
159 if (httpResponse.StatusCode == (int)HttpStatusCode.NotFound && !string.IsNullOrEmpty(m_RedirectURL) && !string.IsNullOrEmpty(id)) 159 if (httpResponse.StatusCode == (int)HttpStatusCode.NotFound && !string.IsNullOrEmpty(m_RedirectURL) && !string.IsNullOrEmpty(id))
160 { 160 {
161 httpResponse.StatusCode = (int)HttpStatusCode.Redirect; 161 httpResponse.StatusCode = (int)HttpStatusCode.Redirect;
diff --git a/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs b/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
index faa6fb7..4d2228a 100644
--- a/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
+++ b/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
@@ -52,8 +52,8 @@ namespace OpenSim.Server.Handlers.Asset.Test
52 52
53 UUID assetId = TestHelpers.ParseTail(0x1); 53 UUID assetId = TestHelpers.ParseTail(0x1);
54 54
55 IConfigSource config = new IniConfigSource(); 55 IConfigSource config = new IniConfigSource();
56 config.AddConfig("AssetService"); 56 config.AddConfig("AssetService");
57 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 57 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
58 58
59 AssetService assetService = new AssetService(config); 59 AssetService assetService = new AssetService(config);
@@ -72,7 +72,7 @@ namespace OpenSim.Server.Handlers.Asset.Test
72 XmlSerializer serializer = new XmlSerializer(typeof(AssetBase)); 72 XmlSerializer serializer = new XmlSerializer(typeof(AssetBase));
73 serializer.Serialize(writer, asset); 73 serializer.Serialize(writer, asset);
74 writer.Flush(); 74 writer.Flush();
75 } 75 }
76 76
77 buffer.Position = 0; 77 buffer.Position = 0;
78 asph.Handle(null, buffer, null, null); 78 asph.Handle(null, buffer, null, null);
@@ -87,13 +87,13 @@ namespace OpenSim.Server.Handlers.Asset.Test
87 { 87 {
88 TestHelpers.InMethod(); 88 TestHelpers.InMethod();
89 89
90 IConfigSource config = new IniConfigSource(); 90 IConfigSource config = new IniConfigSource();
91 config.AddConfig("AssetService"); 91 config.AddConfig("AssetService");
92 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 92 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
93 93
94 AssetService assetService = new AssetService(config); 94 AssetService assetService = new AssetService(config);
95 95
96 AssetServerPostHandler asph = new AssetServerPostHandler(assetService); 96 AssetServerPostHandler asph = new AssetServerPostHandler(assetService);
97 97
98 MemoryStream buffer = new MemoryStream(); 98 MemoryStream buffer = new MemoryStream();
99 byte[] badData = new byte[] { 0x48, 0x65, 0x6c, 0x6c, 0x6f }; 99 byte[] badData = new byte[] { 0x48, 0x65, 0x6c, 0x6c, 0x6f };