diff options
author | Diva Canto | 2011-12-24 07:44:26 -0800 |
---|---|---|
committer | Diva Canto | 2011-12-24 07:44:26 -0800 |
commit | b6cfe15c7c0b3697709179cbbf32818576919642 (patch) | |
tree | a8ccc7f63e150caa159973e7d30b2f49253fa063 | |
parent | HG: one more adjustment with trailing /s (diff) | |
download | opensim-SC-b6cfe15c7c0b3697709179cbbf32818576919642.zip opensim-SC-b6cfe15c7c0b3697709179cbbf32818576919642.tar.gz opensim-SC-b6cfe15c7c0b3697709179cbbf32818576919642.tar.bz2 opensim-SC-b6cfe15c7c0b3697709179cbbf32818576919642.tar.xz |
HG: more / love for Xmas
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 7 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs | 21 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | 27 | ||||
-rw-r--r-- | prebuild.xml | 1 |
4 files changed, 50 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index e9e2dca..1dea87e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | |||
@@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
385 | string assetServerURL = string.Empty; | 385 | string assetServerURL = string.Empty; |
386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | 386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) |
387 | { | 387 | { |
388 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 388 | if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) |
389 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); | 389 | assetServerURL = assetServerURL + "/"; |
390 | |||
391 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); | ||
392 | AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); | ||
390 | return; | 393 | return; |
391 | } | 394 | } |
392 | } | 395 | } |
diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 5c31639..bb5d51f 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs | |||
@@ -29,7 +29,9 @@ using log4net; | |||
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | using System; | 30 | using System; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Collections.Specialized; | ||
32 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Web; | ||
33 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
34 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
35 | using OpenSim.Services.Connectors.Hypergrid; | 37 | using OpenSim.Services.Connectors.Hypergrid; |
@@ -73,11 +75,26 @@ namespace OpenSim.Services.Connectors | |||
73 | if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && | 75 | if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && |
74 | assetUri.Scheme == Uri.UriSchemeHttp) | 76 | assetUri.Scheme == Uri.UriSchemeHttp) |
75 | { | 77 | { |
76 | url = "http://" + assetUri.Authority; | 78 | // Simian |
77 | assetID = assetUri.LocalPath.Trim(new char[] {'/'}); | 79 | if (assetUri.Query != string.Empty) |
80 | { | ||
81 | NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query); | ||
82 | assetID = qscoll["id"]; | ||
83 | if (assetID != null) | ||
84 | url = id.Replace(assetID, ""); // Malformed again, as simian expects | ||
85 | else | ||
86 | url = id; // !!! best effort | ||
87 | } | ||
88 | else // robust | ||
89 | { | ||
90 | url = "http://" + assetUri.Authority; | ||
91 | assetID = assetUri.LocalPath.Trim(new char[] { '/' }); | ||
92 | } | ||
93 | |||
78 | return true; | 94 | return true; |
79 | } | 95 | } |
80 | 96 | ||
97 | m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id); | ||
81 | return false; | 98 | return false; |
82 | } | 99 | } |
83 | 100 | ||
diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index ff1dd5f..8ac89cc 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | |||
@@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors | |||
47 | 47 | ||
48 | public HeloServicesConnector(string serverURI) | 48 | public HeloServicesConnector(string serverURI) |
49 | { | 49 | { |
50 | m_ServerURI = serverURI.TrimEnd('/'); | 50 | if (!serverURI.EndsWith("=")) |
51 | m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; | ||
52 | else | ||
53 | { | ||
54 | // Simian sends malformed urls like this: | ||
55 | // http://valley.virtualportland.org/simtest/Grid/?id= | ||
56 | // | ||
57 | try | ||
58 | { | ||
59 | Uri uri = new Uri(serverURI + "xxx"); | ||
60 | if (uri.Query == string.Empty) | ||
61 | m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; | ||
62 | else | ||
63 | { | ||
64 | serverURI = serverURI + "xxx"; | ||
65 | m_ServerURI = serverURI.Replace("?" + uri.Query, ""); | ||
66 | m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; | ||
67 | } | ||
68 | } | ||
69 | catch (UriFormatException e) | ||
70 | { | ||
71 | m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); | ||
72 | } | ||
73 | } | ||
51 | } | 74 | } |
52 | 75 | ||
53 | 76 | ||
54 | public virtual string Helo() | 77 | public virtual string Helo() |
55 | { | 78 | { |
56 | HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); | 79 | HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); |
57 | // Eventually we need to switch to HEAD | 80 | // Eventually we need to switch to HEAD |
58 | /* req.Method = "HEAD"; */ | 81 | /* req.Method = "HEAD"; */ |
59 | 82 | ||
diff --git a/prebuild.xml b/prebuild.xml index e951187..4ea4708 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -926,6 +926,7 @@ | |||
926 | <ReferencePath>../../../bin/</ReferencePath> | 926 | <ReferencePath>../../../bin/</ReferencePath> |
927 | <Reference name="System"/> | 927 | <Reference name="System"/> |
928 | <Reference name="System.Core"/> | 928 | <Reference name="System.Core"/> |
929 | <Reference name="System.Web"/> | ||
929 | <Reference name="System.Xml"/> | 930 | <Reference name="System.Xml"/> |
930 | <Reference name="System.Drawing"/> | 931 | <Reference name="System.Drawing"/> |
931 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> | 932 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> |