Skip to content

Commit

Permalink
#1298: go back to non-blocking sockets to fix the proxy - at least fo…
Browse files Browse the repository at this point in the history
…r now

git-svn-id: https://xpra.org/svn/Xpra/trunk@14499 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 6, 2016
1 parent 3263b2e commit 1b730a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/xpra/server/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


PROXY_SOCKET_TIMEOUT = float(os.environ.get("XPRA_PROXY_SOCKET_TIMEOUT", "0.1"))
PROXY_WS_TIMEOUT = float(os.environ.get("XPRA_PROXY_WS_TIMEOUT", "0.0"))
PROXY_WS_TIMEOUT = float(os.environ.get("XPRA_PROXY_WS_TIMEOUT", "1.0"))
assert PROXY_SOCKET_TIMEOUT>0, "invalid proxy socket timeout"


Expand Down Expand Up @@ -201,10 +201,10 @@ def disconnect(reason, *extras):
authlog.error(" %s", e)
disconnect(AUTHENTICATION_ERROR, "cannot access sessions")
return
authlog("start_proxy(%s, {..}, %s) found sessions: %s", client_proto, auth_caps, sessions)
if sessions is None:
disconnect(SESSION_NOT_FOUND, "no sessions found")
return
authlog("start_proxy(%s, {..}, %s) found sessions: %s", client_proto, auth_caps, sessions)
uid, gid, displays, env_options, session_options = sessions
if os.name=="posix":
if uid==0 or gid==0:
Expand All @@ -230,6 +230,7 @@ def disconnect(reason, *extras):
display = None
proc = None
sns = c.dictget("start-new-session")
authlog("start_proxy: displays=%s, start-new-session=%s", displays, bool(sns))
if len(displays)==0 or sns:
if self._start_sessions:
#start a new session
Expand Down
2 changes: 0 additions & 2 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,6 @@ def start_websockify(self, conn, req_info, frominfo):
try:
sock = conn._socket
sock.settimeout(self._ws_timeout)
if os.name=="posix":
sock.setblocking(True)
def new_websocket_client(wsh):
wslog("new_websocket_client(%s) socket=%s", wsh, sock)
wsc = WebSocketConnection(sock, conn.local, conn.remote, conn.target, conn.socktype, wsh)
Expand Down

0 comments on commit 1b730a8

Please sign in to comment.