aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorSean Dague2007-11-27 20:37:17 +0000
committerSean Dague2007-11-27 20:37:17 +0000
commitcebdd069f49a5ba6e5bc84eb5e96a63320795226 (patch)
tree1f4cd4022c9cf94ed87081fdabcd62021ccb248d /OpenSim/Region/ClientStack
parentFixed bug, where the clients in a region weren't told to kill a user's avatar... (diff)
downloadopensim-SC_OLD-cebdd069f49a5ba6e5bc84eb5e96a63320795226.zip
opensim-SC_OLD-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.gz
opensim-SC_OLD-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.bz2
opensim-SC_OLD-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.xz
some variable renames to help me read the throttle code
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.PacketQueue.cs42
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs14
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs80
3 files changed, 68 insertions, 68 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
index 4ca7bd9..5916d00 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs
@@ -232,10 +232,10 @@ namespace OpenSim.Region.ClientStack
232 switch (throttlePacketType) 232 switch (throttlePacketType)
233 { 233 {
234 case ThrottleOutPacketType.Resend: 234 case ThrottleOutPacketType.Resend:
235 if (ResendthrottleSentPeriod <= ((int)(ResendthrottleOutbound / throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count == 0) 235 if (ResendBytesSent <= ((int)(ResendthrottleOutbound / throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count == 0)
236 { 236 {
237 throttleSentPeriod += item.Packet.ToBytes().Length; 237 bytesSent += item.Packet.ToBytes().Length;
238 ResendthrottleSentPeriod += item.Packet.ToBytes().Length; 238 ResendBytesSent += item.Packet.ToBytes().Length;
239 PacketQueue.Enqueue(item); 239 PacketQueue.Enqueue(item);
240 } 240 }
241 else 241 else
@@ -244,10 +244,10 @@ namespace OpenSim.Region.ClientStack
244 } 244 }
245 break; 245 break;
246 case ThrottleOutPacketType.Texture: 246 case ThrottleOutPacketType.Texture:
247 if (TexturethrottleSentPeriod <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count == 0) 247 if (TextureBytesSent <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count == 0)
248 { 248 {
249 throttleSentPeriod += item.Packet.ToBytes().Length; 249 bytesSent += item.Packet.ToBytes().Length;
250 TexturethrottleSentPeriod += item.Packet.ToBytes().Length; 250 TextureBytesSent += item.Packet.ToBytes().Length;
251 PacketQueue.Enqueue(item); 251 PacketQueue.Enqueue(item);
252 } 252 }
253 else 253 else
@@ -256,10 +256,10 @@ namespace OpenSim.Region.ClientStack
256 } 256 }
257 break; 257 break;
258 case ThrottleOutPacketType.Task: 258 case ThrottleOutPacketType.Task:
259 if (TaskthrottleSentPeriod <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count == 0) 259 if (TaskBytesSent <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count == 0)
260 { 260 {
261 throttleSentPeriod += item.Packet.ToBytes().Length; 261 bytesSent += item.Packet.ToBytes().Length;
262 TaskthrottleSentPeriod += item.Packet.ToBytes().Length; 262 TaskBytesSent += item.Packet.ToBytes().Length;
263 PacketQueue.Enqueue(item); 263 PacketQueue.Enqueue(item);
264 } 264 }
265 else 265 else
@@ -268,10 +268,10 @@ namespace OpenSim.Region.ClientStack
268 } 268 }
269 break; 269 break;
270 case ThrottleOutPacketType.Land: 270 case ThrottleOutPacketType.Land:
271 if (LandthrottleSentPeriod <= ((int)(LandthrottleOutbound / throttleTimeDivisor)) && LandOutgoingPacketQueue.Count == 0) 271 if (LandBytesSent <= ((int)(LandthrottleOutbound / throttleTimeDivisor)) && LandOutgoingPacketQueue.Count == 0)
272 { 272 {
273 throttleSentPeriod += item.Packet.ToBytes().Length; 273 bytesSent += item.Packet.ToBytes().Length;
274 LandthrottleSentPeriod += item.Packet.ToBytes().Length; 274 LandBytesSent += item.Packet.ToBytes().Length;
275 PacketQueue.Enqueue(item); 275 PacketQueue.Enqueue(item);
276 } 276 }
277 else 277 else
@@ -280,10 +280,10 @@ namespace OpenSim.Region.ClientStack
280 } 280 }
281 break; 281 break;
282 case ThrottleOutPacketType.Asset: 282 case ThrottleOutPacketType.Asset:
283 if (AssetthrottleSentPeriod <= ((int)(AssetthrottleOutbound / throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count == 0) 283 if (AssetBytesSent <= ((int)(AssetthrottleOutbound / throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count == 0)
284 { 284 {
285 throttleSentPeriod += item.Packet.ToBytes().Length; 285 bytesSent += item.Packet.ToBytes().Length;
286 AssetthrottleSentPeriod += item.Packet.ToBytes().Length; 286 AssetBytesSent += item.Packet.ToBytes().Length;
287 PacketQueue.Enqueue(item); 287 PacketQueue.Enqueue(item);
288 } 288 }
289 else 289 else
@@ -292,10 +292,10 @@ namespace OpenSim.Region.ClientStack
292 } 292 }
293 break; 293 break;
294 case ThrottleOutPacketType.Cloud: 294 case ThrottleOutPacketType.Cloud:
295 if (CloudthrottleSentPeriod <= ((int)(CloudthrottleOutbound / throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count == 0) 295 if (CloudBytesSent <= ((int)(CloudthrottleOutbound / throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count == 0)
296 { 296 {
297 throttleSentPeriod += item.Packet.ToBytes().Length; 297 bytesSent += item.Packet.ToBytes().Length;
298 CloudthrottleSentPeriod += item.Packet.ToBytes().Length; 298 CloudBytesSent += item.Packet.ToBytes().Length;
299 PacketQueue.Enqueue(item); 299 PacketQueue.Enqueue(item);
300 } 300 }
301 else 301 else
@@ -304,10 +304,10 @@ namespace OpenSim.Region.ClientStack
304 } 304 }
305 break; 305 break;
306 case ThrottleOutPacketType.Wind: 306 case ThrottleOutPacketType.Wind:
307 if (WindthrottleSentPeriod <= ((int)(WindthrottleOutbound / throttleTimeDivisor)) && WindOutgoingPacketQueue.Count == 0) 307 if (WindBytesSent <= ((int)(WindthrottleOutbound / throttleTimeDivisor)) && WindOutgoingPacketQueue.Count == 0)
308 { 308 {
309 throttleSentPeriod += item.Packet.ToBytes().Length; 309 bytesSent += item.Packet.ToBytes().Length;
310 WindthrottleSentPeriod += item.Packet.ToBytes().Length; 310 WindBytesSent += item.Packet.ToBytes().Length;
311 PacketQueue.Enqueue(item); 311 PacketQueue.Enqueue(item);
312 } 312 }
313 else 313 else
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index f46c199..f720277 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -1048,13 +1048,13 @@ namespace OpenSim.Region.ClientStack
1048 // This has the effect of 'wiggling the slider 1048 // This has the effect of 'wiggling the slider
1049 // causes prim and stuck textures that didn't download to download 1049 // causes prim and stuck textures that didn't download to download
1050 1050
1051 ResendthrottleSentPeriod = 0; 1051 ResendBytesSent = 0;
1052 LandthrottleSentPeriod = 0; 1052 LandBytesSent = 0;
1053 WindthrottleSentPeriod = 0; 1053 WindBytesSent = 0;
1054 CloudthrottleSentPeriod = 0; 1054 CloudBytesSent = 0;
1055 TaskthrottleSentPeriod = 0; 1055 TaskBytesSent = 0;
1056 AssetthrottleSentPeriod = 0; 1056 AssetBytesSent = 0;
1057 TexturethrottleSentPeriod = 0; 1057 TextureBytesSent = 0;
1058 1058
1059 //Yay, we've finally handled the agent Throttle packet! 1059 //Yay, we've finally handled the agent Throttle packet!
1060 1060
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index fbe66db..28692bb 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack
90 // 1536000 90 // 1536000
91 private int throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client) 91 private int throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client)
92 // TODO: Make this variable. Lower throttle on un-ack. Raise over time? 92 // TODO: Make this variable. Lower throttle on un-ack. Raise over time?
93 private int throttleSentPeriod = 0; // Number of bytes sent this period 93 private int bytesSent = 0; // Number of bytes sent this period
94 94
95 private int throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client) 95 private int throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client)
96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time 96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time
@@ -123,19 +123,19 @@ namespace OpenSim.Region.ClientStack
123 123
124 // Sim default per-client settings. 124 // Sim default per-client settings.
125 private int ResendthrottleOutbound = 50000; 125 private int ResendthrottleOutbound = 50000;
126 private int ResendthrottleSentPeriod = 0; 126 private int ResendBytesSent = 0;
127 private int LandthrottleOutbound = 100000; 127 private int LandthrottleOutbound = 100000;
128 private int LandthrottleSentPeriod = 0; 128 private int LandBytesSent = 0;
129 private int WindthrottleOutbound = 10000; 129 private int WindthrottleOutbound = 10000;
130 private int WindthrottleSentPeriod = 0; 130 private int WindBytesSent = 0;
131 private int CloudthrottleOutbound = 5000; 131 private int CloudthrottleOutbound = 5000;
132 private int CloudthrottleSentPeriod = 0; 132 private int CloudBytesSent = 0;
133 private int TaskthrottleOutbound = 100000; 133 private int TaskthrottleOutbound = 100000;
134 private int TaskthrottleSentPeriod = 0; 134 private int TaskBytesSent = 0;
135 private int AssetthrottleOutbound = 80000; 135 private int AssetthrottleOutbound = 80000;
136 private int AssetthrottleSentPeriod = 0; 136 private int AssetBytesSent = 0;
137 private int TexturethrottleOutbound = 100000; 137 private int TexturethrottleOutbound = 100000;
138 private int TexturethrottleSentPeriod = 0; 138 private int TextureBytesSent = 0;
139 139
140 private Timer throttleTimer; 140 private Timer throttleTimer;
141 141
@@ -196,14 +196,14 @@ namespace OpenSim.Region.ClientStack
196 196
197 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e) 197 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e)
198 { 198 {
199 throttleSentPeriod = 0; 199 bytesSent = 0;
200 ResendthrottleSentPeriod = 0; 200 ResendBytesSent = 0;
201 LandthrottleSentPeriod = 0; 201 LandBytesSent = 0;
202 WindthrottleSentPeriod = 0; 202 WindBytesSent = 0;
203 CloudthrottleSentPeriod = 0; 203 CloudBytesSent = 0;
204 TaskthrottleSentPeriod = 0; 204 TaskBytesSent = 0;
205 AssetthrottleSentPeriod = 0; 205 AssetBytesSent = 0;
206 TexturethrottleSentPeriod = 0; 206 TextureBytesSent = 0;
207 207
208 // I was considering this.. Will an event fire if the thread it's on is blocked? 208 // I was considering this.. Will an event fire if the thread it's on is blocked?
209 209
@@ -216,7 +216,7 @@ namespace OpenSim.Region.ClientStack
216 216
217 // We're going to dequeue all of the saved up packets until 217 // We're going to dequeue all of the saved up packets until
218 // we've hit the throttle limit or there's no more packets to send 218 // we've hit the throttle limit or there's no more packets to send
219 while ((throttleSentPeriod <= ((int)(throttleOutbound/throttleTimeDivisor)) && 219 while ((bytesSent <= ((int)(throttleOutbound/throttleTimeDivisor)) &&
220 (ResendOutgoingPacketQueue.Count > 0 || 220 (ResendOutgoingPacketQueue.Count > 0 ||
221 LandOutgoingPacketQueue.Count > 0 || 221 LandOutgoingPacketQueue.Count > 0 ||
222 WindOutgoingPacketQueue.Count > 0 || 222 WindOutgoingPacketQueue.Count > 0 ||
@@ -227,61 +227,61 @@ namespace OpenSim.Region.ClientStack
227 { 227 {
228 throttleLoops++; 228 throttleLoops++;
229 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up. 229 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up.
230 if (ResendthrottleSentPeriod <= ((int)(ResendthrottleOutbound/throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count > 0) 230 if (ResendBytesSent <= ((int)(ResendthrottleOutbound/throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count > 0)
231 { 231 {
232 QueItem qpack = ResendOutgoingPacketQueue.Dequeue(); 232 QueItem qpack = ResendOutgoingPacketQueue.Dequeue();
233 233
234 PacketQueue.Enqueue(qpack); 234 PacketQueue.Enqueue(qpack);
235 throttleSentPeriod += qpack.Packet.ToBytes().Length; 235 bytesSent += qpack.Packet.ToBytes().Length;
236 ResendthrottleSentPeriod += qpack.Packet.ToBytes().Length; 236 ResendBytesSent += qpack.Packet.ToBytes().Length;
237 } 237 }
238 if (LandthrottleSentPeriod <= ((int)(LandthrottleOutbound/throttleTimeDivisor)) && LandOutgoingPacketQueue.Count > 0) 238 if (LandBytesSent <= ((int)(LandthrottleOutbound/throttleTimeDivisor)) && LandOutgoingPacketQueue.Count > 0)
239 { 239 {
240 QueItem qpack = LandOutgoingPacketQueue.Dequeue(); 240 QueItem qpack = LandOutgoingPacketQueue.Dequeue();
241 241
242 PacketQueue.Enqueue(qpack); 242 PacketQueue.Enqueue(qpack);
243 throttleSentPeriod += qpack.Packet.ToBytes().Length; 243 bytesSent += qpack.Packet.ToBytes().Length;
244 LandthrottleSentPeriod += qpack.Packet.ToBytes().Length; 244 LandBytesSent += qpack.Packet.ToBytes().Length;
245 } 245 }
246 if (WindthrottleSentPeriod <= ((int)(WindthrottleOutbound/throttleTimeDivisor)) && WindOutgoingPacketQueue.Count > 0) 246 if (WindBytesSent <= ((int)(WindthrottleOutbound/throttleTimeDivisor)) && WindOutgoingPacketQueue.Count > 0)
247 { 247 {
248 QueItem qpack = WindOutgoingPacketQueue.Dequeue(); 248 QueItem qpack = WindOutgoingPacketQueue.Dequeue();
249 249
250 PacketQueue.Enqueue(qpack); 250 PacketQueue.Enqueue(qpack);
251 throttleSentPeriod += qpack.Packet.ToBytes().Length; 251 bytesSent += qpack.Packet.ToBytes().Length;
252 WindthrottleSentPeriod += qpack.Packet.ToBytes().Length; 252 WindBytesSent += qpack.Packet.ToBytes().Length;
253 } 253 }
254 if (CloudthrottleSentPeriod <= ((int)(CloudthrottleOutbound/throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count > 0) 254 if (CloudBytesSent <= ((int)(CloudthrottleOutbound/throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count > 0)
255 { 255 {
256 QueItem qpack = CloudOutgoingPacketQueue.Dequeue(); 256 QueItem qpack = CloudOutgoingPacketQueue.Dequeue();
257 257
258 PacketQueue.Enqueue(qpack); 258 PacketQueue.Enqueue(qpack);
259 throttleSentPeriod += qpack.Packet.ToBytes().Length; 259 bytesSent += qpack.Packet.ToBytes().Length;
260 CloudthrottleSentPeriod += qpack.Packet.ToBytes().Length; 260 CloudBytesSent += qpack.Packet.ToBytes().Length;
261 } 261 }
262 if (TaskthrottleSentPeriod <= ((int)(TaskthrottleOutbound/throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count > 0) 262 if (TaskBytesSent <= ((int)(TaskthrottleOutbound/throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count > 0)
263 { 263 {
264 QueItem qpack = TaskOutgoingPacketQueue.Dequeue(); 264 QueItem qpack = TaskOutgoingPacketQueue.Dequeue();
265 265
266 PacketQueue.Enqueue(qpack); 266 PacketQueue.Enqueue(qpack);
267 throttleSentPeriod += qpack.Packet.ToBytes().Length; 267 bytesSent += qpack.Packet.ToBytes().Length;
268 TaskthrottleSentPeriod += qpack.Packet.ToBytes().Length; 268 TaskBytesSent += qpack.Packet.ToBytes().Length;
269 } 269 }
270 if (TexturethrottleSentPeriod <= ((int)(TexturethrottleOutbound/throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count > 0) 270 if (TextureBytesSent <= ((int)(TexturethrottleOutbound/throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count > 0)
271 { 271 {
272 QueItem qpack = TextureOutgoingPacketQueue.Dequeue(); 272 QueItem qpack = TextureOutgoingPacketQueue.Dequeue();
273 273
274 PacketQueue.Enqueue(qpack); 274 PacketQueue.Enqueue(qpack);
275 throttleSentPeriod += qpack.Packet.ToBytes().Length; 275 bytesSent += qpack.Packet.ToBytes().Length;
276 TexturethrottleSentPeriod += qpack.Packet.ToBytes().Length; 276 TextureBytesSent += qpack.Packet.ToBytes().Length;
277 } 277 }
278 if (AssetthrottleSentPeriod <= ((int)(AssetthrottleOutbound/throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count > 0) 278 if (AssetBytesSent <= ((int)(AssetthrottleOutbound/throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count > 0)
279 { 279 {
280 QueItem qpack = AssetOutgoingPacketQueue.Dequeue(); 280 QueItem qpack = AssetOutgoingPacketQueue.Dequeue();
281 281
282 PacketQueue.Enqueue(qpack); 282 PacketQueue.Enqueue(qpack);
283 throttleSentPeriod += qpack.Packet.ToBytes().Length; 283 bytesSent += qpack.Packet.ToBytes().Length;
284 AssetthrottleSentPeriod += qpack.Packet.ToBytes().Length; 284 AssetBytesSent += qpack.Packet.ToBytes().Length;
285 } 285 }
286 286
287 } 287 }
@@ -441,7 +441,7 @@ namespace OpenSim.Region.ClientStack
441 else 441 else
442 { 442 {
443 // Throw it back on the queue if it's going to cause us to flood the client 443 // Throw it back on the queue if it's going to cause us to flood the client
444 if (throttleSentPeriod > throttleOutboundMax) 444 if (bytesSent > throttleOutboundMax)
445 { 445 {
446 PacketQueue.Enqueue(nextPacket); 446 PacketQueue.Enqueue(nextPacket);
447 MainLog.Instance.Verbose("Client over throttle limit, requeuing packet"); 447 MainLog.Instance.Verbose("Client over throttle limit, requeuing packet");
@@ -462,7 +462,7 @@ namespace OpenSim.Region.ClientStack
462 462
463 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()! 463 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()!
464 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply) 464 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply)
465 throttleSentPeriod += nextPacket.Packet.ToBytes().Length; 465 bytesSent += nextPacket.Packet.ToBytes().Length;
466 466
467 467
468 //is a out going packet 468 //is a out going packet