Skip to content

Commit

Permalink
#2812 honour the ACK_JITTER instead of hard-coding another value
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@28228 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 22, 2020
1 parent edf48e9 commit 79b026a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,10 @@ def get_packets_backlog(self):
return 0
latency_tolerance_pct = int(min(self._damage_packet_sequence, 10) *
min(monotonic_time()-gs.last_congestion_time, 10))
return s.get_packets_backlog(latency_tolerance_pct)
latency = s.target_latency + ACK_JITTER/1000*(1+latency_tolerance_pct/100)
#log("get_packets_backlog() latency=%s (target=%i, tolerance=%i)",
# 1000*latency, 1000*s.target_latency, latency_tolerance_pct)
return s.get_late_acks(latency)

def expire_delayed_region(self, due=0):
""" mark the region as expired so damage_packet_acked can send it later,
Expand Down
8 changes: 1 addition & 7 deletions src/xpra/server/window/window_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,10 @@ def get_late_acks(self, latency):
#start_send_at = item[0]
#end_send_at = item[3]
late = sum(1 for item in self.damage_ack_pending.values() if item[3]>0 and item[0]<=sent_before)
log("get_late_acks(%i)=%i (%i in full pending list)",
log("get_late_acks(%s)=%i (%i in full pending list)",
latency, late, len(self.damage_ack_pending))
return late

def get_packets_backlog(self, latency_tolerance_pct=100):
latency = (self.target_latency+0.020)*latency_tolerance_pct/100.0
#log("get_packets_backlog(%i) latency=%s, target=%i",
# latency_tolerance_pct, latency, self.target_latency)
return self.get_late_acks(latency)

def get_pixels_encoding_backlog(self):
pixels, count = 0, 0
for _, w, h in self.encoding_pending.values():
Expand Down

0 comments on commit 79b026a

Please sign in to comment.