Skip to content

Commit

Permalink
#1211: whackamole, all platforms need the timeout, only win32 needs t…
Browse files Browse the repository at this point in the history
…he workaround for WSAEWOULDBLOCK

git-svn-id: https://xpra.org/svn/Xpra/trunk@13872 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 25, 2016
1 parent e12894f commit 387c2d3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,16 +686,14 @@ def start_websockify(self, conn, frominfo):
try:
sock = conn._socket
WIN32 = sys.platform.startswith("win")
OSX = sys.platform.startswith("darwin")
if WIN32 or OSX:
#the HTTP server fails on win32 if we don't use blocking sockets!
sock.settimeout(10.0)
sock.settimeout(10.0)
def new_websocket_client(wsh):
netlog("new_websocket_client(%s) socket=%s", wsh, sock)
wsc = WebSocketConnection(sock, conn.local, conn.remote, conn.target, conn.socktype, wsh)
if WIN32 or OSX:
# win32 servers don't seem to honour our request to use blocking sockets
# (this workaround should not be needed on any other platform,
if WIN32:
# win32 servers don't seem to honour our request to use blocking sockets,
# and we need this workaround for non-blocking sockets
# (it should not be needed on any other platform,
# and maybe this should go in websockify somewhere instead)
from xpra.net.bytestreams import untilConcludes
saved_recv = sock.recv
Expand Down

0 comments on commit 387c2d3

Please sign in to comment.