Skip to content

Commit

Permalink
#999: only apply MIN_BANDWIDTH if we have a value to apply it to
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@18999 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 6, 2018
1 parent b4c00b5 commit 693da41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xpra/server/source/client_connection.py
Expand Up @@ -194,14 +194,16 @@ def update_bandwidth_limits(self):
#calculate soft bandwidth limit based on send congestion data:
bandwidth_limit = 0
if BANDWIDTH_DETECTION:
bandwidth_limit = max(MIN_BANDWIDTH, self.statistics.avg_congestion_send_speed)
bandwidth_limit = self.statistics.avg_congestion_send_speed
bandwidthlog("avg_congestion_send_speed=%s", bandwidth_limit)
if bandwidth_limit>20*1024*1024:
#ignore congestion speed if greater 20Mbps
bandwidth_limit = 0
if self.bandwidth_limit>0:
#command line options could overrule what we detect?
bandwidth_limit = min(self.bandwidth_limit, bandwidth_limit)
if bandwidth_limit>0:
bandwidth_limit = max(MIN_BANDWIDTH, bandwidth_limit)
self.soft_bandwidth_limit = bandwidth_limit
bandwidthlog("update_bandwidth_limits() bandwidth_limit=%s, soft bandwidth limit=%s", self.bandwidth_limit, bandwidth_limit)
if self.soft_bandwidth_limit<=0:
Expand Down

0 comments on commit 693da41

Please sign in to comment.