aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Asset
diff options
context:
space:
mode:
authorDan Lake2012-01-03 16:52:53 -0800
committerDan Lake2012-01-03 16:52:53 -0800
commitecf9824b63d181bd4e64bd5cb0ff37b952669bb9 (patch)
tree269207a773c6bd1fd8383885e0c5649d70b34a62 /OpenSim/Services/Connectors/Asset
parentAccess to these static methods to serialize objects are useful outside of ser... (diff)
parentUpdate C5.dll to version 1.1.1 from 1.1.0 (diff)
downloadopensim-SC_OLD-ecf9824b63d181bd4e64bd5cb0ff37b952669bb9.zip
opensim-SC_OLD-ecf9824b63d181bd4e64bd5cb0ff37b952669bb9.tar.gz
opensim-SC_OLD-ecf9824b63d181bd4e64bd5cb0ff37b952669bb9.tar.bz2
opensim-SC_OLD-ecf9824b63d181bd4e64bd5cb0ff37b952669bb9.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors/Asset')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs6
-rw-r--r--OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs21
2 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
index fdab254..d7b2ff8 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
@@ -100,6 +100,8 @@ namespace OpenSim.Services.Connectors
100 100
101 public AssetBase Get(string id) 101 public AssetBase Get(string id)
102 { 102 {
103// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id);
104
103 string uri = m_ServerURI + "/assets/" + id; 105 string uri = m_ServerURI + "/assets/" + id;
104 106
105 AssetBase asset = null; 107 AssetBase asset = null;
@@ -119,6 +121,8 @@ namespace OpenSim.Services.Connectors
119 121
120 public AssetBase GetCached(string id) 122 public AssetBase GetCached(string id)
121 { 123 {
124// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
125
122 if (m_Cache != null) 126 if (m_Cache != null)
123 return m_Cache.Get(id); 127 return m_Cache.Get(id);
124 128
@@ -177,6 +181,8 @@ namespace OpenSim.Services.Connectors
177 181
178 public bool Get(string id, Object sender, AssetRetrieved handler) 182 public bool Get(string id, Object sender, AssetRetrieved handler)
179 { 183 {
184// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id);
185
180 string uri = m_ServerURI + "/assets/" + id; 186 string uri = m_ServerURI + "/assets/" + id;
181 187
182 AssetBase asset = null; 188 AssetBase asset = null;
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;
29using Nini.Config; 29using Nini.Config;
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Collections.Specialized;
32using System.Reflection; 33using System.Reflection;
34using System.Web;
33using OpenSim.Framework; 35using OpenSim.Framework;
34using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
35using OpenSim.Services.Connectors.Hypergrid; 37using 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