summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/handlers/receive-backpressure_wsh.py
blob: 9c2e4709fdd48e82b52ae14b65a43be2478ea9e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/python

import time


def web_socket_do_extra_handshake(request):
    # Turn off permessage-deflate, otherwise it shrinks our 8MB buffer to 8KB.
    request.ws_extension_processors = []


def web_socket_transfer_data(request):
    # Wait two seconds to cause backpressure.
    time.sleep(2);
    request.ws_stream.receive_message()