Fix SSL websocket
This commit is contained in:
parent
43a7886eae
commit
9e2668e6da
1 changed files with 7 additions and 3 deletions
|
@ -390,6 +390,9 @@ class WebSocket(object):
|
||||||
self._frame_mask = None
|
self._frame_mask = None
|
||||||
self._cont_data = None
|
self._cont_data = None
|
||||||
|
|
||||||
|
# Do not allow simultaneous send - leads to SSL issues!
|
||||||
|
self.lock = threading.Lock()
|
||||||
|
|
||||||
def fileno(self):
|
def fileno(self):
|
||||||
return self.sock.fileno()
|
return self.sock.fileno()
|
||||||
|
|
||||||
|
@ -565,9 +568,10 @@ class WebSocket(object):
|
||||||
length = len(data)
|
length = len(data)
|
||||||
if traceEnabled:
|
if traceEnabled:
|
||||||
logger.debug("send: " + repr(data))
|
logger.debug("send: " + repr(data))
|
||||||
while data:
|
with self.lock:
|
||||||
l = self._send(data)
|
while data:
|
||||||
data = data[l:]
|
l = self._send(data)
|
||||||
|
data = data[l:]
|
||||||
return length
|
return length
|
||||||
|
|
||||||
def send_binary(self, payload):
|
def send_binary(self, payload):
|
||||||
|
|
Loading…
Reference in a new issue