GetAssets: only throttle mesh and texture

0.9.1.0-post-fixes
UbitUmarov 2018-12-06 02:28:26 +00:00
parent deb0ab7400
commit d2bfe986bf
2 changed files with 12 additions and 4 deletions

View File

@ -136,8 +136,10 @@ namespace OpenSim.Capabilities.Handlers
return responsedata; return responsedata;
} }
// if(type != AssetType.Mesh && type != AssetType.Texture) if(type == AssetType.Mesh || type == AssetType.Texture)
// m_log.Warn("[GETASSETS]: type: " + query); responsedata["throttle"] = true;
// else
// m_log.Warn("[GETASSETS]: type: " + query);
responsedata["content_type"] = asset.Metadata.ContentType; responsedata["content_type"] = asset.Metadata.ContentType;
responsedata["bin_response_data"] = asset.Data; responsedata["bin_response_data"] = asset.Data;

View File

@ -72,6 +72,7 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
public Hashtable response; public Hashtable response;
public int bytes; public int bytes;
public bool throttle;
} }
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -244,7 +245,9 @@ namespace OpenSim.Region.ClientStack.Linden
if (m_presence == null || m_presence.IsDeleted) if (m_presence == null || m_presence.IsDeleted)
return true; return true;
if(response.throttle)
return m_presence.CapCanSendAsset(1, response.bytes); return m_presence.CapCanSendAsset(1, response.bytes);
return m_presence.CapCanSendAsset(2, response.bytes);
} }
return false; return false;
} }
@ -352,11 +355,14 @@ namespace OpenSim.Region.ClientStack.Linden
} }
} }
responses[requestID] = new APollResponse() APollResponse preq= new APollResponse()
{ {
bytes = (int)curresponse["int_bytes"], bytes = (int)curresponse["int_bytes"],
response = curresponse response = curresponse
}; };
if(curresponse.Contains("throttle"))
preq.throttle = true;
responses[requestID] = preq;
} }
} }
} }