Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 1cd39d8

Browse files
committed
Handle bugs in preable receipt in tests
1 parent 5bd9eb0 commit 1cd39d8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/test_integration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ def build_headers_frame(headers, encoder=None):
5454

5555
def receive_preamble(sock):
5656
# Receive the HTTP/2 'preamble'.
57-
sock.recv(65535)
58-
sock.recv(65535)
57+
first = sock.recv(65535)
58+
59+
# Work around some bugs: if the first message received was only the PRI
60+
# string, aim to receive a settings frame as well.
61+
if len(first) <= len(b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n'):
62+
sock.recv(65535)
5963
sock.send(SettingsFrame(0).serialize())
6064
sock.recv(65535)
6165
return

0 commit comments

Comments
 (0)