Skip to content

Commit

Permalink
#1838: the packet queue belongs in the core class (also fix logging o…
Browse files Browse the repository at this point in the history
…f mixin variables that may not exist)

git-svn-id: https://xpra.org/svn/Xpra/trunk@19375 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 23, 2018
1 parent 8a6d8c3 commit 6651dde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/xpra/server/source/client_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# later version. See the file COPYING for details.

from threading import Event
from collections import deque

from xpra.log import Logger
log = Logger("server")
Expand Down Expand Up @@ -119,6 +120,10 @@ def __init__(self, protocol, disconnect_cb, session_name, server,
except Exception as e:
raise Exception("failed to initialize %s: %s" % (bc, e))

self.packet_queue = deque() #holds actual packets ready for sending (already encoded)
#these packets are picked off by the "protocol" via 'next_packet()'
#format: packet, wid, pixels, start_send_cb, end_send_cb
#(only packet is required - the rest can be 0/None for clipboard packets)
self.ordinary_packets = []
self.socket_dir = socket_dir
self.unix_socket_paths = unix_socket_paths
Expand Down Expand Up @@ -238,6 +243,7 @@ def parse_hello(self, c):
self.info_namespace = c.boolget("info-namespace")
self.send_notifications = c.boolget("notifications")
self.send_notifications_actions = c.boolget("notifications.actions")
log("notifications=%s, actions=%s", self.send_notifications, self.send_notifications_actions)
self.share = c.boolget("share")
self.lock = c.boolget("lock")
self.control_commands = c.strlistget("control_commands")
Expand All @@ -247,7 +253,6 @@ def parse_hello(self, c):
else:
self.bandwidth_limit = min(self.server_bandwidth_limit, bandwidth_limit)
bandwidthlog("server bandwidth-limit=%s, client bandwidth-limit=%s, value=%s", self.server_bandwidth_limit, bandwidth_limit, self.bandwidth_limit)
log("cursors=%s (encodings=%s), bell=%s, notifications=%s", self.send_cursors, self.cursor_encodings, self.send_bell, self.send_notifications)

cinfo = self.get_connect_info()
for i,ci in enumerate(cinfo):
Expand Down
4 changes: 0 additions & 4 deletions src/xpra/server/source/encodings_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ def __init__(self):
self.encode_work_queue = Queue() #holds functions to call to compress data (pixels, clipboard)
#items placed in this queue are picked off by the "encode" thread,
#the functions should add the packets they generate to the 'packet_queue'
self.packet_queue = deque() #holds actual packets ready for sending (already encoded)
#these packets are picked off by the "protocol" via 'next_packet()'
#format: packet, wid, pixels, start_send_cb, end_send_cb
#(only packet is required - the rest can be 0/None for clipboard packets)
self.encode_thread = start_thread(self.encode_loop, "encode")

def init_from(self, _protocol, server):
Expand Down

0 comments on commit 6651dde

Please sign in to comment.