aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-11-27 15:14:34 +0000
committerUbitUmarov2016-11-27 15:14:34 +0000
commit877d3092b45723a2fe8b3a5bbc224cd5d5e55e82 (patch)
treef11a5b2d85443fefc81e1958c82828a16fc656cc /OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
parentfix pool parameters for httptests (diff)
parentHG on links request build the URI in http format with a / at end, this should... (diff)
downloadopensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.zip
opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.gz
opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.bz2
opensim-SC-877d3092b45723a2fe8b3a5bbc224cd5d5e55e82.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs22
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
index d4603f8..cac57b2 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
@@ -97,7 +97,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
97 /// </summary> 97 /// </summary>
98 protected float m_burst; 98 protected float m_burst;
99 99
100 public virtual float MaxDripRate { get; set; } 100 protected float m_maxDripRate = 0;
101 public virtual float MaxDripRate
102 {
103 get { return m_maxDripRate; }
104 set { m_maxDripRate = value; }
105 }
101 106
102 public float RequestedBurst 107 public float RequestedBurst
103 { 108 {
@@ -134,7 +139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
134 /// the system tick interval (typically around 15-22ms)</remarks> 139 /// the system tick interval (typically around 15-22ms)</remarks>
135 protected float m_dripRate; 140 protected float m_dripRate;
136 141
137 public virtual float RequestedDripRate 142 public float RequestedDripRate
138 { 143 {
139 get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); } 144 get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); }
140 set { 145 set {
@@ -146,7 +151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
146 } 151 }
147 } 152 }
148 153
149 public virtual float DripRate 154 public float DripRate
150 { 155 {
151 get { 156 get {
152 float rate = Math.Min(RequestedDripRate,TotalDripRequest); 157 float rate = Math.Min(RequestedDripRate,TotalDripRequest);
@@ -344,7 +349,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
344 // greater than this. 349 // greater than this.
345 // </summary> 350 // </summary>
346 351
347 protected float m_maxDripRate = 0;
348 public override float MaxDripRate 352 public override float MaxDripRate
349 { 353 {
350 get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } 354 get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); }
@@ -359,7 +363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
359 // <summary> 363 // <summary>
360 // Adjust drip rate in response to network conditions. 364 // Adjust drip rate in response to network conditions.
361 // </summary> 365 // </summary>
362 public virtual float AdjustedDripRate 366 public float AdjustedDripRate
363 { 367 {
364 get { return m_dripRate; } 368 get { return m_dripRate; }
365 set 369 set
@@ -380,12 +384,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
380 { 384 {
381 m_enabled = enabled; 385 m_enabled = enabled;
382 386
383 MaxDripRate = maxDripRate; 387 m_maxDripRate = (maxDripRate == 0 ? m_totalDripRequest : Math.Max(maxDripRate, m_minimumFlow));
384 388
385 if (enabled) 389 if (enabled)
386 AdjustedDripRate = m_maxDripRate * .5f; 390 m_dripRate = m_maxDripRate * .5f;
387 else 391 else
388 AdjustedDripRate = m_maxDripRate; 392 m_dripRate = m_maxDripRate;
393 if (m_parent != null)
394 m_parent.RegisterRequest(this, m_dripRate);
389 } 395 }
390 396
391 /// <summary> 397 /// <summary>