Windows compatibility fixes
- there is no errno.WSAEAGAIN, only errno.WSAEWOULDBLOCK
This commit is contained in:
parent
a4b1a781ce
commit
f94b2d2d4b
|
@ -116,11 +116,9 @@ class receiveDataThread(threading.Thread):
|
||||||
logger.error ('SSL error: %i/%s', err.errno if err.errno else 0, str(err))
|
logger.error ('SSL error: %i/%s', err.errno if err.errno else 0, str(err))
|
||||||
break
|
break
|
||||||
except socket.error as err:
|
except socket.error as err:
|
||||||
if err.errno in (errno.EAGAIN, errno.EWOULDBLOCK):
|
if err.errno in (errno.EAGAIN, errno.EWOULDBLOCK) or \
|
||||||
select.select([self.sslSock if isSSL else self.sock], [], [], 10)
|
(sys.platform.startswith('win') and \
|
||||||
logger.debug('sock.recv retriable error')
|
err.errno in (errno.WSAEWOULDBLOCK)):
|
||||||
continue
|
|
||||||
if sys.platform.startswith('win') and err.errno in (errno.WSAEAGAIN, errno.WSAEWOULDBLOCK):
|
|
||||||
select.select([self.sslSock if isSSL else self.sock], [], [], 10)
|
select.select([self.sslSock if isSSL else self.sock], [], [], 10)
|
||||||
logger.debug('sock.recv retriable error')
|
logger.debug('sock.recv retriable error')
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -98,11 +98,9 @@ class sendDataThread(threading.Thread):
|
||||||
continue
|
continue
|
||||||
raise
|
raise
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
if e.errno in (errno.EAGAIN, errno.EWOULDBLOCK):
|
if e.errno in (errno.EAGAIN, errno.EWOULDBLOCK) or \
|
||||||
select.select([], [self.sslSock if isSSL else self.sock], [], 10)
|
(sys.platform.startswith('win') and \
|
||||||
logger.debug('sock.recv retriable error')
|
e.errno in (errno.WSAEWOULDBLOCK)):
|
||||||
continue
|
|
||||||
if sys.platform.startswith('win') and e.errno in (errno.WSAEAGAIN, errno.WSAEWOULDBLOCK):
|
|
||||||
select.select([], [self.sslSock if isSSL else self.sock], [], 10)
|
select.select([], [self.sslSock if isSSL else self.sock], [], 10)
|
||||||
logger.debug('sock.recv retriable error')
|
logger.debug('sock.recv retriable error')
|
||||||
continue
|
continue
|
||||||
|
|
Reference in New Issue
Block a user