aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDr Scofield2009-03-24 08:21:50 +0000
committerDr Scofield2009-03-24 08:21:50 +0000
commitb5f6aa6ff271ef3db95570f48bdf0e4a2b775e33 (patch)
treecc217d60165db250e359e9c760c257da9e2fc75e /OpenSim/Framework
parentPreparing the loginauth service for gridmode logins. (diff)
downloadopensim-SC-b5f6aa6ff271ef3db95570f48bdf0e4a2b775e33.zip
opensim-SC-b5f6aa6ff271ef3db95570f48bdf0e4a2b775e33.tar.gz
opensim-SC-b5f6aa6ff271ef3db95570f48bdf0e4a2b775e33.tar.bz2
opensim-SC-b5f6aa6ff271ef3db95570f48bdf0e4a2b775e33.tar.xz
From: Alan Webb <alan_webb@us.ibm.com>
Changes to AssetCache and DynamicTextureModule to eliminate opportunities for lost texture updates.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs22
1 files changed, 9 insertions, 13 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 7d06a1e..bd0b1b1 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -350,7 +350,7 @@ namespace OpenSim.Framework.Communications.Cache
350 // If it's a direct request for a script, drop it 350 // If it's a direct request for a script, drop it
351 // because it's a hacked client 351 // because it's a hacked client
352 if (req.AssetRequestSource != 2 || assetInf.Type != 10) 352 if (req.AssetRequestSource != 2 || assetInf.Type != 10)
353 AssetRequests.Add(req); 353 lock(AssetRequests) AssetRequests.Add(req);
354 } 354 }
355 } 355 }
356 356
@@ -487,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache
487 req.Params = transferRequest.TransferInfo.Params; 487 req.Params = transferRequest.TransferInfo.Params;
488 req.AssetInf = new AssetInfo(asset); 488 req.AssetInf = new AssetInfo(asset);
489 req.NumPackets = CalculateNumPackets(asset.Data); 489 req.NumPackets = CalculateNumPackets(asset.Data);
490 AssetRequests.Add(req); 490 lock(AssetRequests) AssetRequests.Add(req);
491 } 491 }
492 492
493 /// <summary> 493 /// <summary>
@@ -506,16 +506,16 @@ namespace OpenSim.Framework.Communications.Cache
506 int num = Math.Min(5, AssetRequests.Count); 506 int num = Math.Min(5, AssetRequests.Count);
507 507
508 AssetRequest req; 508 AssetRequest req;
509 AssetRequestToClient req2 = null; 509 AssetRequestToClient req2 = new AssetRequestToClient();
510
510 for (int i = 0; i < num; i++) 511 for (int i = 0; i < num; i++)
511 { 512 {
512 req = AssetRequests[i]; 513 lock(AssetRequests)
513 if (req2 == null)
514 { 514 {
515 req2 = new AssetRequestToClient(); 515 req = AssetRequests[0];
516 AssetRequests.RemoveAt(0);
516 } 517 }
517 518
518 // Trying to limit memory usage by only creating AssetRequestToClient if needed
519 req2.AssetInf = req.AssetInf; 519 req2.AssetInf = req.AssetInf;
520 req2.AssetRequestSource = req.AssetRequestSource; 520 req2.AssetRequestSource = req.AssetRequestSource;
521 req2.DataPointer = req.DataPointer; 521 req2.DataPointer = req.DataPointer;
@@ -528,13 +528,9 @@ namespace OpenSim.Framework.Communications.Cache
528 req2.RequestAssetID = req.RequestAssetID; 528 req2.RequestAssetID = req.RequestAssetID;
529 req2.TransferRequestID = req.TransferRequestID; 529 req2.TransferRequestID = req.TransferRequestID;
530 req.RequestUser.SendAsset(req2); 530 req.RequestUser.SendAsset(req2);
531 }
532 531
533 //remove requests that have been completed
534 for (int i = 0; i < num; i++)
535 {
536 AssetRequests.RemoveAt(0);
537 } 532 }
533
538 } 534 }
539 535
540 public class AssetRequest 536 public class AssetRequest