_abnf, _socket: Don't override builtins
This commit is contained in:
parent
669096e874
commit
17cfffbff1
websocket
@ -344,9 +344,9 @@ class frame_buffer(object):
|
||||
# reads is limited by socket buffer and is relatively small,
|
||||
# yet passing large numbers repeatedly causes lots of large
|
||||
# buffers allocated and then shrunk, which results in fragmentation.
|
||||
bytes = self.recv(min(16384, shortage))
|
||||
self.recv_buffer.append(bytes)
|
||||
shortage -= len(bytes)
|
||||
bytes_ = self.recv(min(16384, shortage))
|
||||
self.recv_buffer.append(bytes_)
|
||||
shortage -= len(bytes_)
|
||||
|
||||
unified = six.b("").join(self.recv_buffer)
|
||||
|
||||
|
@ -74,7 +74,7 @@ def recv(sock, bufsize):
|
||||
raise WebSocketConnectionClosedException("socket is already closed.")
|
||||
|
||||
try:
|
||||
bytes = sock.recv(bufsize)
|
||||
bytes_ = sock.recv(bufsize)
|
||||
except socket.timeout as e:
|
||||
message = extract_err_message(e)
|
||||
raise WebSocketTimeoutException(message)
|
||||
@ -85,10 +85,10 @@ def recv(sock, bufsize):
|
||||
else:
|
||||
raise
|
||||
|
||||
if not bytes:
|
||||
if not bytes_:
|
||||
raise WebSocketConnectionClosedException("Connection is already closed.")
|
||||
|
||||
return bytes
|
||||
return bytes_
|
||||
|
||||
|
||||
def recv_line(sock):
|
||||
|
Loading…
x
Reference in New Issue
Block a user