mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Changed the GetTextureModule backport to work with the 0.6.9 codebase
This commit is contained in:
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
|
||||
// Try to parse the texture ID from the request URL
|
||||
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
||||
string textureStr = query.GetOne("texture_id");
|
||||
string textureStr = GetOne(query, "texture_id");
|
||||
|
||||
if (m_assetService == null)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
|
||||
private void SendTexture(OSHttpRequest request, OSHttpResponse response, AssetBase texture)
|
||||
{
|
||||
string range = request.Headers.GetOne("Range");
|
||||
string range = GetOne(request.Headers, "Range");
|
||||
if (!String.IsNullOrEmpty(range))
|
||||
{
|
||||
// Range request
|
||||
@@ -216,5 +216,14 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
|
||||
start = end = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string GetOne(NameValueCollection collection, string key)
|
||||
{
|
||||
string[] values = collection.GetValues(key);
|
||||
if (values != null && values.Length > 0)
|
||||
return values[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user