summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications/websockets.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-08-30 16:59:35 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-08-30 16:59:35 +0300
commitcb36616132434853707714cb548f03080950c08f (patch)
treee9b484f4d1e31c1813edf07a812dcd1f25223460 /test/unit/applications/websockets.py
parentccd6c0dc057e32ae50aec6d692a624119b1aa925 (diff)
downloadunit-cb36616132434853707714cb548f03080950c08f.tar.gz
unit-cb36616132434853707714cb548f03080950c08f.tar.bz2
Tests: prevented writing to the closed socket for websocket tests.
Diffstat (limited to 'test/unit/applications/websockets.py')
-rw-r--r--test/unit/applications/websockets.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py
index 0a343875..47eebd9c 100644
--- a/test/unit/applications/websockets.py
+++ b/test/unit/applications/websockets.py
@@ -180,7 +180,10 @@ class TestApplicationWebsocket(TestApplicationProto):
frame_len = len(frame)
while pos < frame_len:
end = min(pos + chopsize, frame_len)
- sock.sendall(frame[pos:end])
+ try:
+ sock.sendall(frame[pos:end])
+ except BrokenPipeError:
+ end = frame_len
pos = end
def message(self, sock, type, message, fragmention_size=None, **kwargs):