Skip to content

Commit

Permalink
expose the list of packet handlers via xpra info
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@18569 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 24, 2018
1 parent aaa388f commit 1c8bc46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from xpra.server.mixins.window_server import WindowServer

from xpra.os_util import thread, monotonic_time, bytestostr, WIN32, PYTHON3
from xpra.util import typedict, flatten_dict, updict, merge_dicts, envbool, envint, \
from xpra.util import typedict, flatten_dict, updict, merge_dicts, envbool, envint, csv, \
SERVER_EXIT, SERVER_ERROR, SERVER_SHUTDOWN, DETACH_REQUEST, NEW_CLIENT, DONE, IDLE_TIMEOUT, SESSION_BUSY
from xpra.net.bytestreams import set_socket_timeout
from xpra.platform.paths import get_icon_filename, get_icon_dir
Expand Down Expand Up @@ -566,6 +566,15 @@ def get_info(self, proto=None, client_uuids=None, wids=None, *args):
log("ServerBase.get_info took %.1fms", 1000.0*(monotonic_time()-start))
return info

def get_packet_handlers_info(self):
info = ServerCore.get_packet_handlers_info(self)
info.update({
"authenticated" : sorted(self._authenticated_packet_handlers.keys()),
"ui" : sorted(self._authenticated_ui_packet_handlers.keys()),
})
return info


def get_features_info(self):
i = {
"randr" : self.randr,
Expand Down
6 changes: 6 additions & 0 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ def up(prefix, d):
"encryption" : self.encryption or "",
"tcp-encryption" : self.tcp_encryption or "",
"bandwidth-limit": self.bandwidth_limit or 0,
"packet-handlers" : self.get_packet_handlers_info(),
"www" : {
"" : self._html,
"dir" : self._www_dir or "",
Expand All @@ -1725,6 +1726,11 @@ def up(prefix, d):
log("ServerCore.get_info took %ims", (end-start)*1000)
return info

def get_packet_handlers_info(self):
return {
"default" : sorted(self._default_packet_handlers.keys()),
}

def get_socket_info(self):
si = {}
for socktype, _, info in self._socket_info:
Expand Down

0 comments on commit 1c8bc46

Please sign in to comment.