Fix not sending TransferInfo when an asset is not found. This clogs

up the sound pipeline in the viewer.
0.7.3-extended
Melanie 2012-06-06 20:35:00 +02:00 committed by Justin Clark-Casey (justincc)
parent d4ff56710b
commit a3586a7c4b
1 changed files with 29 additions and 4 deletions

View File

@ -2722,6 +2722,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
public void SendAssetNotFound(AssetRequestToClient req)
{
TransferInfoPacket Transfer = new TransferInfoPacket();
Transfer.TransferInfo.ChannelType = 2;
Transfer.TransferInfo.Status = -2;
Transfer.TransferInfo.TargetType = 0;
Transfer.TransferInfo.Params = req.Params;
Transfer.TransferInfo.Size = 0;
Transfer.TransferInfo.TransferID = req.TransferRequestID;
Transfer.Header.Zerocoded = true;
OutPacket(Transfer, ThrottleOutPacketType.Asset);
}
public void SendTexture(AssetBase TextureAsset) public void SendTexture(AssetBase TextureAsset)
{ {
@ -12032,14 +12045,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="asset"></param> /// <param name="asset"></param>
protected void AssetReceived(string id, Object sender, AssetBase asset) protected void AssetReceived(string id, Object sender, AssetBase asset)
{ {
if (asset == null)
return;
TransferRequestPacket transferRequest = (TransferRequestPacket)sender; TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
UUID requestID = UUID.Zero; UUID requestID = UUID.Zero;
byte source = (byte)SourceType.Asset; byte source = (byte)SourceType.Asset;
AssetRequestToClient req = new AssetRequestToClient();
if (asset == null)
{
req.AssetInf = null;
req.AssetRequestSource = source;
req.IsTextureRequest = false;
req.NumPackets = 0;
req.Params = transferRequest.TransferInfo.Params;
req.RequestAssetID = requestID;
req.TransferRequestID = transferRequest.TransferInfo.TransferID;
SendAssetNotFound(req);
return;
}
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
{ {
requestID = new UUID(transferRequest.TransferInfo.Params, 0); requestID = new UUID(transferRequest.TransferInfo.Params, 0);
@ -12056,7 +12082,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return; return;
// The asset is known to exist and is in our cache, so add it to the AssetRequests list // The asset is known to exist and is in our cache, so add it to the AssetRequests list
AssetRequestToClient req = new AssetRequestToClient();
req.AssetInf = asset; req.AssetInf = asset;
req.AssetRequestSource = source; req.AssetRequestSource = source;
req.IsTextureRequest = false; req.IsTextureRequest = false;