diff options
author | Justin Clarke Casey | 2008-11-03 21:09:30 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-03 21:09:30 +0000 |
commit | 4ff0c391530ad8ce937d281f4ac6492c760080db (patch) | |
tree | bc00794793c9d0f1c35ea5ed902f0312d2692c22 /OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | |
parent | * mionr: correct CONTRIBUTORS file for Plugh (diff) | |
download | opensim-SC_OLD-4ff0c391530ad8ce937d281f4ac6492c760080db.zip opensim-SC_OLD-4ff0c391530ad8ce937d281f4ac6492c760080db.tar.gz opensim-SC_OLD-4ff0c391530ad8ce937d281f4ac6492c760080db.tar.bz2 opensim-SC_OLD-4ff0c391530ad8ce937d281f4ac6492c760080db.tar.xz |
* Expose a client_throttle_multiplier setting in OpenSim.ini. This multiplier is applied to all the client throttle settings received by the client
* This should probably be 1, but currently by default it is 8, to reflect what was being eon3 in OpenSim before this revision. So if the client requested a maximum throttle
of 1500 kilobits per second, we would actually send out 1500 kilobytes per second
* Adjusting this multiplier down towards 1 may improve your OpenSim experience, though in other situations it may degrade (e.g. if you're using a standalone over high bandwidth
links)
* This is currently a user setting because adjusting it down may currently reveal other OpenSim bugs.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index 98b613e..2c67d63 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | |||
@@ -34,12 +34,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
34 | private int m_currentThrottle; | 34 | private int m_currentThrottle; |
35 | private const int m_throttleTimeDivisor = 7; | 35 | private const int m_throttleTimeDivisor = 7; |
36 | private int m_currentBitsSent; | 36 | private int m_currentBitsSent; |
37 | |||
38 | /// <value> | ||
39 | /// Temporary field | ||
40 | /// </value> | ||
41 | private float m_throttleMultiplier; | ||
37 | 42 | ||
38 | public LLPacketThrottle(int Min, int Max, int Throttle) | 43 | /// <summary> |
44 | /// Constructor. | ||
45 | /// </summary> | ||
46 | /// <param name="min"></param> | ||
47 | /// <param name="max"></param> | ||
48 | /// <param name="throttle"></param> | ||
49 | /// <param name="throttleMultiplier"> | ||
50 | /// A temporary parameter that's ends up multiplying all throttle settings. This only exists as a path to | ||
51 | /// using real throttle values instead of the *8 multipler that we had been using (bytes instead of btis) | ||
52 | /// </param> | ||
53 | public LLPacketThrottle(int min, int max, int throttle, float throttleMultiplier) | ||
39 | { | 54 | { |
40 | m_maxAllowableThrottle = Max; | 55 | m_throttleMultiplier = throttleMultiplier; |
41 | m_minAllowableThrottle = Min; | 56 | m_maxAllowableThrottle = (int)(max * throttleMultiplier); |
42 | m_currentThrottle = Throttle; | 57 | m_minAllowableThrottle = (int)(Min * throttleMultiplier); |
58 | m_currentThrottle = (int)(Throttle * throttleMultiplier); | ||
43 | m_currentBitsSent = 0; | 59 | m_currentBitsSent = 0; |
44 | } | 60 | } |
45 | 61 | ||
@@ -61,9 +77,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
61 | 77 | ||
62 | public int AddBytes(int bytes) | 78 | public int AddBytes(int bytes) |
63 | { | 79 | { |
64 | // XXX: Temporarily treat bytes as bits. This is a temporary revert of r6714 until other underlying issues | 80 | m_currentBitsSent += bytes * 8; |
65 | // are addressed. | ||
66 | m_currentBitsSent += bytes; | ||
67 | return m_currentBitsSent; | 81 | return m_currentBitsSent; |
68 | } | 82 | } |
69 | 83 | ||
@@ -83,17 +97,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
83 | get { return m_currentThrottle; } | 97 | get { return m_currentThrottle; } |
84 | set | 98 | set |
85 | { | 99 | { |
86 | if (value > m_maxAllowableThrottle) | 100 | int multipliedValue = (int)(value * m_throttleMultiplier); |
101 | |||
102 | if (multipliedValue > m_maxAllowableThrottle) | ||
87 | { | 103 | { |
88 | m_currentThrottle = m_maxAllowableThrottle; | 104 | m_currentThrottle = m_maxAllowableThrottle; |
89 | } | 105 | } |
90 | else if (value < m_minAllowableThrottle) | 106 | else if (multipliedValue < m_minAllowableThrottle) |
91 | { | 107 | { |
92 | m_currentThrottle = m_minAllowableThrottle; | 108 | m_currentThrottle = m_minAllowableThrottle; |
93 | } | 109 | } |
94 | else | 110 | else |
95 | { | 111 | { |
96 | m_currentThrottle = value; | 112 | m_currentThrottle = multipliedValue; |
97 | } | 113 | } |
98 | } | 114 | } |
99 | } | 115 | } |