Skip to content

Commit

Permalink
fix detection of html5 client path, log what we find
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@20010 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 3, 2018
1 parent 3438a6a commit 87e6397
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from time import sleep

from xpra.log import Logger
from xpra.platform.paths import get_app_dir
log = Logger("server")
netlog = Logger("network")
httplog = Logger("http")
Expand Down Expand Up @@ -459,9 +460,13 @@ def init_html_proxy(self, opts):
if www_dir:
self._www_dir = www_dir
else:
for d in ("www", "html5"):
self._www_dir = os.path.abspath(os.path.join(get_resources_dir(), d))
for ad,d in (
(get_resources_dir(), "html5"),
(get_app_dir(), "www"),
):
self._www_dir = os.path.abspath(os.path.join(ad, d))
if os.path.exists(self._www_dir):
httplog("found html5 client in '%s'", self._www_dir)
break
self._http_headers_dir = os.path.abspath(os.path.join(self._www_dir, "../http-headers"))
if not os.path.exists(self._www_dir) and self._html:
Expand Down Expand Up @@ -1040,7 +1045,7 @@ def may_wrap_socket(self, conn, socktype, peek_data=b"", line1=b""):
return True, conn, peek_data
frominfo = pretty_socket(conn.remote)
netlog("may_wrap_socket(..) peek_data=%s from %s", binascii.hexlify(peek_data), frominfo)
if self.ssh_upgrade and peek_data[:4]=="SSH-":
if self.ssh_upgrade and peek_data[:4]==b"SSH-":
conn = self.handle_ssh_connection(conn)
return conn!=None, conn, None
elif self._ssl_wrap_socket and peek_data[0] in (chr(0x16), 0x16):
Expand Down

0 comments on commit 87e6397

Please sign in to comment.