summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/applications')
-rw-r--r--test/unit/applications/websockets.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py
index 3553af6e..5f9c3c51 100644
--- a/test/unit/applications/websockets.py
+++ b/test/unit/applications/websockets.py
@@ -61,15 +61,9 @@ class TestApplicationWebsocket(TestApplicationProto):
def recv_bytes(sock, bytes):
data = b''
while select.select([sock], [], [], read_timeout)[0]:
- try:
- if bytes < 65536:
- data = sock.recv(bytes)
- else:
- data = self.recvall(
- sock, read_timeout=read_timeout, buff_size=bytes
- )
- break
- except:
+ data += sock.recv(bytes - len(data))
+
+ if len(data) == bytes:
break
return data