diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
3 files changed, 35 insertions, 14 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index 54cf285..bb932f2 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
63 | private bool m_Enabled = false; | 63 | private bool m_Enabled = false; |
64 | 64 | ||
65 | // TODO: Change this to a config option | 65 | // TODO: Change this to a config option |
66 | const string REDIRECT_URL = null; | 66 | private string m_RedirectURL = null; |
67 | 67 | ||
68 | private string m_URL; | 68 | private string m_URL; |
69 | 69 | ||
@@ -78,7 +78,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
78 | m_URL = config.GetString("Cap_GetTexture", string.Empty); | 78 | m_URL = config.GetString("Cap_GetTexture", string.Empty); |
79 | // Cap doesn't exist | 79 | // Cap doesn't exist |
80 | if (m_URL != string.Empty) | 80 | if (m_URL != string.Empty) |
81 | { | ||
81 | m_Enabled = true; | 82 | m_Enabled = true; |
83 | m_RedirectURL = config.GetString("GetTextureRedirectURL"); | ||
84 | } | ||
82 | } | 85 | } |
83 | 86 | ||
84 | public void AddRegion(Scene s) | 87 | public void AddRegion(Scene s) |
@@ -132,14 +135,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
132 | // m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); | 135 | // m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); |
133 | caps.RegisterHandler( | 136 | caps.RegisterHandler( |
134 | "GetTexture", | 137 | "GetTexture", |
135 | new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString())); | 138 | new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString(), m_RedirectURL)); |
136 | } | 139 | } |
137 | else | 140 | else |
138 | { | 141 | { |
139 | // m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); | 142 | // m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); |
140 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); | 143 | IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>(); |
141 | if (handler != null) | 144 | if (handler != null) |
142 | handler.RegisterExternalUserCapsHandler(agentID,caps,"GetTexture",m_URL); | 145 | handler.RegisterExternalUserCapsHandler(agentID,caps,"GetTexture", m_URL); |
143 | else | 146 | else |
144 | caps.RegisterHandler("GetTexture", m_URL); | 147 | caps.RegisterHandler("GetTexture", m_URL); |
145 | } | 148 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs index edc5016..ee1ea1a 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs | |||
@@ -152,7 +152,7 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests | |||
152 | 152 | ||
153 | // A sanity check that the response has the expected number of descendents for a default inventory | 153 | // A sanity check that the response has the expected number of descendents for a default inventory |
154 | // TODO: Need a more thorough check. | 154 | // TODO: Need a more thorough check. |
155 | Assert.That((int)folderOsd["descendents"], Is.EqualTo(14)); | 155 | Assert.That((int)folderOsd["descendents"], Is.EqualTo(16)); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | } \ No newline at end of file | 158 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 53217a0..c28e58d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -8949,7 +8949,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8949 | if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | 8949 | if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) |
8950 | { | 8950 | { |
8951 | string assetServer = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | 8951 | string assetServer = aCircuit.ServiceURLs["AssetServerURI"].ToString(); |
8952 | return ((Scene)Scene).AssetService.Get(assetServer + "/" + id); | 8952 | if (!string.IsNullOrEmpty(assetServer)) |
8953 | return ((Scene)Scene).AssetService.Get(assetServer + "/" + id); | ||
8953 | } | 8954 | } |
8954 | 8955 | ||
8955 | return null; | 8956 | return null; |
@@ -12658,16 +12659,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12658 | 12659 | ||
12659 | if (asset == null) | 12660 | if (asset == null) |
12660 | { | 12661 | { |
12661 | req.AssetInf = null; | 12662 | // Try the user's asset server |
12662 | req.AssetRequestSource = source; | 12663 | IInventoryAccessModule inventoryAccessModule = Scene.RequestModuleInterface<IInventoryAccessModule>(); |
12663 | req.IsTextureRequest = false; | 12664 | |
12664 | req.NumPackets = 0; | 12665 | string assetServerURL = string.Empty; |
12665 | req.Params = transferRequest.TransferInfo.Params; | 12666 | if (inventoryAccessModule.IsForeignUser(AgentId, out assetServerURL) && !string.IsNullOrEmpty(assetServerURL)) |
12666 | req.RequestAssetID = requestID; | 12667 | { |
12667 | req.TransferRequestID = transferRequest.TransferInfo.TransferID; | 12668 | if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) |
12669 | assetServerURL = assetServerURL + "/"; | ||
12670 | |||
12671 | //m_log.DebugFormat("[LLCLIENTVIEW]: asset {0} not found in local storage. Trying user's storage.", assetServerURL + id); | ||
12672 | asset = m_scene.AssetService.Get(assetServerURL + id); | ||
12673 | } | ||
12674 | |||
12675 | if (asset == null) | ||
12676 | { | ||
12677 | req.AssetInf = null; | ||
12678 | req.AssetRequestSource = source; | ||
12679 | req.IsTextureRequest = false; | ||
12680 | req.NumPackets = 0; | ||
12681 | req.Params = transferRequest.TransferInfo.Params; | ||
12682 | req.RequestAssetID = requestID; | ||
12683 | req.TransferRequestID = transferRequest.TransferInfo.TransferID; | ||
12684 | |||
12685 | SendAssetNotFound(req); | ||
12686 | return; | ||
12687 | } | ||
12668 | 12688 | ||
12669 | SendAssetNotFound(req); | ||
12670 | return; | ||
12671 | } | 12689 | } |
12672 | 12690 | ||
12673 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | 12691 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) |