Skip to content

Commit

Permalink
#1836 delay XpraProxy import until needed
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@19275 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 11, 2018
1 parent 77947c2 commit 81b128d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
ENCRYPTION_CIPHERS, ENCRYPT_FIRST_PACKET, DEFAULT_IV, DEFAULT_SALT, DEFAULT_ITERATIONS, INITIAL_PADDING, DEFAULT_PADDING, ALL_PADDING_OPTIONS
from xpra.server.background_worker import stop_worker, get_worker
from xpra.make_thread import start_thread
from xpra.scripts.fdproxy import XpraProxy
from xpra.server.control_command import ControlError, HelloCommand, HelpCommand, DebugControl
from xpra.util import csv, merge_dicts, typedict, notypedict, flatten_dict, parse_simple_dict, repr_ellipsized, dump_all_frames, nonl, envint, envbool, envfloat, \
SERVER_SHUTDOWN, SERVER_UPGRADE, LOGIN_TIMEOUT, DONE, PROTOCOL_ERROR, SERVER_ERROR, VERSION_ERROR, CLIENT_REQUEST, SERVER_EXIT

Expand Down Expand Up @@ -529,6 +527,7 @@ def get_auth_module(self, socket_type, auth_str, opts):
######################################################################
# control commands:
def init_control_commands(self):
from xpra.server.control_command import HelloCommand, HelpCommand, DebugControl
self.control_commands = {"hello" : HelloCommand(),
"debug" : DebugControl()}
help_command = HelpCommand(self.control_commands)
Expand All @@ -542,6 +541,7 @@ def handle_command_request(self, proto, *args):
proto.send_now(("hello", hello))

def process_control_command(self, *args):
from xpra.server.control_command import ControlError
assert len(args)>0
name = args[0]
try:
Expand Down Expand Up @@ -1142,6 +1142,7 @@ def start_tcp_proxy(self, conn, frominfo):
sock.settimeout(1)

#now start forwarding:
from xpra.scripts.fdproxy import XpraProxy
p = XpraProxy(frominfo, conn, tcp_server_connection, self.tcp_proxy_quit)
self._tcp_proxy_clients.append(p)
proxylog.info("client connection from %s forwarded to proxy server on %s:%s", frominfo, host, port)
Expand Down

0 comments on commit 81b128d

Please sign in to comment.