Skip to content

Commit

Permalink
always include connection info
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 23, 2022
1 parent 4e0fec2 commit 107b8d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
10 changes: 10 additions & 0 deletions xpra/server/proxy/proxy_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,16 @@ def get_window_info(self) -> dict:
return info


def get_connection_info(self) -> dict:
return {
"client" : self.client_protocol.get_info(),
"server" : self.server_protocol.get_info(),
}

def get_info(self) -> dict:
return {"connection" : self.get_connection_info()}


################################################################################

def send_hello(self, challenge_response=None, client_salt=None):
Expand Down
4 changes: 3 additions & 1 deletion xpra/server/proxy/proxy_instance_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ def do_process_control_packet(self, proto, packet):
def is_req(mode):
return generic_request==mode or caps.boolget("%s_request" % mode)
if is_req("info"):
proto.send_now(("hello", self.get_proxy_info(proto)))
info = self.get_proxy_info(proto)
info.setdefault("connection", {}).update(self.get_connection_info())
proto.send_now(("hello", info))
self.timeout_add(5*1000, self.send_disconnect, proto, CLIENT_EXIT_TIMEOUT, "info sent")
return
if is_req("stop"):
Expand Down
11 changes: 0 additions & 11 deletions xpra/server/proxy/proxy_instance_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,3 @@ def start_network_threads(self):
#no need to start the client protocol,
#it was started when we processed authentication in the proxy server
#self.client_protocol.start()


def get_info(self) -> dict:
info = {}
cinfo = info.setdefault("connection", {})
def add_protocol_info(prefix, proto):
pinfo = proto.get_info()
cinfo[prefix] = pinfo.get("thread", ())
add_protocol_info("client", self.client_protocol)
add_protocol_info("server", self.server_protocol)
return info

0 comments on commit 107b8d2

Please sign in to comment.