aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-14 11:52:48 -0700
committerJohn Hurliman2009-10-14 11:52:48 -0700
commitc033477d2faf1449685d471db243651f132a7632 (patch)
tree8a91e154e13634439f0ef06678cd6e7dbe611c69 /OpenSim/Region
parentMerge branch 'htb-throttle' of ssh://opensimulator.org/var/git/opensim into h... (diff)
downloadopensim-SC_OLD-c033477d2faf1449685d471db243651f132a7632.zip
opensim-SC_OLD-c033477d2faf1449685d471db243651f132a7632.tar.gz
opensim-SC_OLD-c033477d2faf1449685d471db243651f132a7632.tar.bz2
opensim-SC_OLD-c033477d2faf1449685d471db243651f132a7632.tar.xz
* Read scene_throttle_bps from the config file and use it
* Minor formatting cleanup
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs11
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs4
2 files changed, 5 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 25542ab..d25bf95 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -184,7 +184,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
184 { 184 {
185 int sent; 185 int sent;
186 bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent); 186 bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent);
187
188 packetsSent += sent; 187 packetsSent += sent;
189 188
190 // If the send is complete, destroy any knowledge of this transfer 189 // If the send is complete, destroy any knowledge of this transfer
@@ -234,20 +233,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
234 image.PriorityQueueHandle = null; 233 image.PriorityQueueHandle = null;
235 234
236 lock (m_syncRoot) 235 lock (m_syncRoot)
237 try 236 try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
238 {
239 m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
240 }
241 catch (Exception) { } 237 catch (Exception) { }
242 } 238 }
243 239
244 void RemoveImageFromQueue(J2KImage image) 240 void RemoveImageFromQueue(J2KImage image)
245 { 241 {
246 lock (m_syncRoot) 242 lock (m_syncRoot)
247 try 243 try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
248 {
249 m_priorityQueue.Delete(image.PriorityQueueHandle);
250 }
251 catch (Exception) { } 244 catch (Exception) { }
252 } 245 }
253 246
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 1cfde91..384eda7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -138,15 +138,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
138 #endregion Environment.TickCount Measurement 138 #endregion Environment.TickCount Measurement
139 139
140 m_circuitManager = circuitManager; 140 m_circuitManager = circuitManager;
141 int sceneThrottleBps = 0;
141 142
142 IConfig config = configSource.Configs["ClientStack.LindenUDP"]; 143 IConfig config = configSource.Configs["ClientStack.LindenUDP"];
143 if (config != null) 144 if (config != null)
144 { 145 {
145 m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0); 146 m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0);
147 sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0);
146 } 148 }
147 149
148 // TODO: Config support for throttling the entire connection 150 // TODO: Config support for throttling the entire connection
149 m_throttle = new TokenBucket(null, 0, 0); 151 m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps);
150 m_throttleRates = new ThrottleRates(configSource); 152 m_throttleRates = new ThrottleRates(configSource);
151 } 153 }
152 154