aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/TextureSender.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-02-25 23:26:35 +0000
committerJustin Clarke Casey2008-02-25 23:26:35 +0000
commit65862aaceadc69218895e07b5d547266b12916a9 (patch)
tree67449a6fe51b5c86cc14e75a41589cbaa2c5be5b /OpenSim/Region/Environment/Modules/TextureSender.cs
parentMoved AsyncCommandManager into separate classes under "plugins". (diff)
downloadopensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.zip
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.gz
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.bz2
opensim-SC_OLD-65862aaceadc69218895e07b5d547266b12916a9.tar.xz
* Start sending "ImageNotFound" packet back to the client if we can't find an image
* This might stop some client's constant requests for unfound textures, which is a candidate for the memory leak * If a texture is not found then the "Image not found" texture will now be displayed clientside * If it works, this should resolve mantis 676 * Non texture image requests do not receive this packet yet * This will require a prebuild
Diffstat (limited to 'OpenSim/Region/Environment/Modules/TextureSender.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/TextureSender.cs33
1 files changed, 25 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/TextureSender.cs b/OpenSim/Region/Environment/Modules/TextureSender.cs
index 056b8e1..3d097c8 100644
--- a/OpenSim/Region/Environment/Modules/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/TextureSender.cs
@@ -31,6 +31,7 @@ using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
34using OpenSim.Region.Environment.Interfaces;
34 35
35namespace OpenSim.Region.Environment.Modules 36namespace OpenSim.Region.Environment.Modules
36{ 37{
@@ -38,7 +39,7 @@ namespace OpenSim.Region.Environment.Modules
38 /// A TextureSender handles the process of receiving a texture requested by the client from the 39 /// A TextureSender handles the process of receiving a texture requested by the client from the
39 /// AssetCache, and then sending that texture back to the client. 40 /// AssetCache, and then sending that texture back to the client.
40 /// </summary> 41 /// </summary>
41 public class TextureSender 42 public class TextureSender : ITextureSender
42 { 43 {
43 private static readonly log4net.ILog m_log 44 private static readonly log4net.ILog m_log
44 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 45 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -67,9 +68,25 @@ namespace OpenSim.Region.Environment.Modules
67 /// </summary> 68 /// </summary>
68 private int PacketCounter = 0; 69 private int PacketCounter = 0;
69 70
70 public bool Cancel = false; 71 // See ITextureSender
72 public bool Cancel
73 {
74 get { return false; }
75 set { m_cancel = value; }
76 }
77
78 private bool m_cancel = false;
79
80 // See ITextureSender
81 public bool Sending
82 {
83 get { return false; }
84 set { m_sending = value; }
85 }
86
87 private bool m_sending = false;
88
71 public bool ImageLoaded = false; 89 public bool ImageLoaded = false;
72 public bool Sending = false;
73 90
74 private IClientAPI RequestUser; 91 private IClientAPI RequestUser;
75 92
@@ -97,6 +114,7 @@ namespace OpenSim.Region.Environment.Modules
97 ImageLoaded = true; 114 ImageLoaded = true;
98 } 115 }
99 116
117 // See ITextureSender
100 public void UpdateRequest(int discardLevel, uint packetNumber) 118 public void UpdateRequest(int discardLevel, uint packetNumber)
101 { 119 {
102 RequestedDiscardLevel = discardLevel; 120 RequestedDiscardLevel = discardLevel;
@@ -104,12 +122,11 @@ namespace OpenSim.Region.Environment.Modules
104 PacketCounter = (int) StartPacketNumber; 122 PacketCounter = (int) StartPacketNumber;
105 } 123 }
106 124
107 /// <summary> 125 // See ITextureSender
108 /// Send a texture packet to the client.
109 /// </summary>
110 /// <returns>True if the last packet has been sent, false otherwise.</returns>
111 public bool SendTexturePacket() 126 public bool SendTexturePacket()
112 { 127 {
128 //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID);
129
113 SendPacket(); 130 SendPacket();
114 counter++; 131 counter++;
115 if ((NumPackets == 0) || (RequestedDiscardLevel == -1) || (PacketCounter > NumPackets) || 132 if ((NumPackets == 0) || (RequestedDiscardLevel == -1) || (PacketCounter > NumPackets) ||
@@ -170,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules
170 } 187 }
171 catch (ArgumentOutOfRangeException) 188 catch (ArgumentOutOfRangeException)
172 { 189 {
173 m_log.Error("[TEXTURE]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + 190 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
174 m_asset.FullID.ToString() ); 191 m_asset.FullID.ToString() );
175 return; 192 return;
176 } 193 }