Skip to content

Commit

Permalink
allow the proxy server to run on python3
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13939 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 30, 2016
1 parent d0abba0 commit 84c6474
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 8 additions & 3 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def is_msvc():
from xpra.platform.features import LOCAL_SERVERS_SUPPORTED, SHADOW_SUPPORTED
shadow_ENABLED = SHADOW_SUPPORTED and not PYTHON3 and DEFAULT #shadow servers use some GTK2 code..
server_ENABLED = (LOCAL_SERVERS_SUPPORTED or shadow_ENABLED) and not PYTHON3 and DEFAULT
proxy_ENABLED = DEFAULT
client_ENABLED = DEFAULT

x11_ENABLED = DEFAULT and not WIN32 and not OSX
Expand Down Expand Up @@ -223,7 +224,9 @@ def is_msvc():
"gtk2", "gtk3", "html5", "pam",
"sound", "opengl", "printing",
"rebuild",
"annotate", "warn", "strict", "shadow", "debug", "PIC",
"annotate", "warn", "strict",
"shadow", "proxy",
"debug", "PIC",
"Xdummy", "Xdummy_wrapper", "verbose", "tests", "bundle_tests"]
if WIN32:
SWITCHES.append("zip")
Expand Down Expand Up @@ -1896,7 +1899,9 @@ def osx_pkgconfig(*pkgs_options, **ekw):


toggle_packages(dbus_ENABLED, "xpra.dbus")
toggle_packages(server_ENABLED, "xpra.server", "xpra.server.auth", "xpra.server.proxy", "xpra.server.window")
toggle_packages(server_ENABLED or proxy_ENABLED, "xpra.server")
toggle_packages(proxy_ENABLED, "xpra.server.proxy")
toggle_packages(server_ENABLED, "xpra.server.auth", "xpra.server.window")
toggle_packages(server_ENABLED and shadow_ENABLED, "xpra.server.shadow")
toggle_packages(server_ENABLED or (client_ENABLED and gtk2_ENABLED), "xpra.clipboard")
#cannot use toggle here as py2exe will complain if we try to exclude this module:
Expand Down Expand Up @@ -2020,7 +2025,7 @@ def osx_pkgconfig(*pkgs_options, **ekw):
toggle_packages(client_ENABLED or server_ENABLED, "xpra.keyboard")
if client_ENABLED or server_ENABLED:
add_modules("xpra.scripts.config", "xpra.scripts.exec_util", "xpra.scripts.fdproxy", "xpra.scripts.version")
if server_ENABLED:
if server_ENABLED or proxy_ENABLED:
add_modules("xpra.scripts.server")
if WIN32 and client_ENABLED and (gtk2_ENABLED or gtk3_ENABLED):
add_modules("xpra.scripts.gtk_info")
Expand Down
9 changes: 4 additions & 5 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# later version. See the file COPYING for details.

import binascii
import types
import os
import sys
import time
Expand All @@ -31,7 +30,7 @@
from xpra.scripts.config import InitException, parse_bool
from xpra.net.bytestreams import SocketConnection, log_new_connection, inject_ssl_socket_info, pretty_socket, SOCKET_TIMEOUT
from xpra.platform import set_name
from xpra.os_util import load_binary_file, get_machine_id, get_user_uuid, platform_name, SIGNAMES
from xpra.os_util import load_binary_file, get_machine_id, get_user_uuid, platform_name, bytestostr, SIGNAMES
from xpra.version_util import version_compat_check, get_version_info_full, get_platform_info, get_host_info, local_version
from xpra.net.protocol import Protocol, get_network_caps, sanity_checks
from xpra.net.crypto import crypto_backend_init, new_cipher_caps, get_salt, \
Expand Down Expand Up @@ -1207,10 +1206,10 @@ def get_socket_info(self):


def process_packet(self, proto, packet):
packet_type = None
handler = None
try:
handler = None
packet_type = packet[0]
assert isinstance(packet_type, types.StringTypes), "packet_type %s is not a string: %s..." % (type(packet_type), str(packet_type)[:100])
packet_type = bytestostr(packet[0])
handler = self._default_packet_handlers.get(packet_type)
if handler:
netlog("process packet %s", packet_type)
Expand Down

0 comments on commit 84c6474

Please sign in to comment.