HG: more / love for Xmas
parent
f9a1fd5748
commit
b6cfe15c7c
|
@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
string assetServerURL = string.Empty;
|
||||
if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL))
|
||||
{
|
||||
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
|
||||
AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
|
||||
if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
|
||||
assetServerURL = assetServerURL + "/";
|
||||
|
||||
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id);
|
||||
AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,9 @@ using log4net;
|
|||
using Nini.Config;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Services.Connectors.Hypergrid;
|
||||
|
@ -72,12 +74,27 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) &&
|
||||
assetUri.Scheme == Uri.UriSchemeHttp)
|
||||
{
|
||||
// Simian
|
||||
if (assetUri.Query != string.Empty)
|
||||
{
|
||||
NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query);
|
||||
assetID = qscoll["id"];
|
||||
if (assetID != null)
|
||||
url = id.Replace(assetID, ""); // Malformed again, as simian expects
|
||||
else
|
||||
url = id; // !!! best effort
|
||||
}
|
||||
else // robust
|
||||
{
|
||||
url = "http://" + assetUri.Authority;
|
||||
assetID = assetUri.LocalPath.Trim(new char[] {'/'});
|
||||
assetID = assetUri.LocalPath.Trim(new char[] { '/' });
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
public HeloServicesConnector(string serverURI)
|
||||
{
|
||||
m_ServerURI = serverURI.TrimEnd('/');
|
||||
if (!serverURI.EndsWith("="))
|
||||
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
|
||||
else
|
||||
{
|
||||
// Simian sends malformed urls like this:
|
||||
// http://valley.virtualportland.org/simtest/Grid/?id=
|
||||
//
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(serverURI + "xxx");
|
||||
if (uri.Query == string.Empty)
|
||||
m_ServerURI = serverURI.TrimEnd('/') + "/helo/";
|
||||
else
|
||||
{
|
||||
serverURI = serverURI + "xxx";
|
||||
m_ServerURI = serverURI.Replace("?" + uri.Query, "");
|
||||
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
|
||||
}
|
||||
}
|
||||
catch (UriFormatException e)
|
||||
{
|
||||
m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual string Helo()
|
||||
{
|
||||
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/");
|
||||
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
|
||||
// Eventually we need to switch to HEAD
|
||||
/* req.Method = "HEAD"; */
|
||||
|
||||
|
|
|
@ -926,6 +926,7 @@
|
|||
<ReferencePath>../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Core"/>
|
||||
<Reference name="System.Web"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
|
|
Loading…
Reference in New Issue