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

Commit 3a02fe1

Browse files
committed
fix socket.recv usage
1 parent 8089d97 commit 3a02fe1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test_integration.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ def reusable_frame_buffer(buffer):
7676
def receive_preamble(sock):
7777
# Receive the HTTP/2 'preamble'.
7878
client_preface = b'PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n'
79-
timeout = time.time() + 5
8079
got = b''
81-
while len(got) < len(client_preface) and time.time() < timeout:
82-
got += sock.recv(len(client_preface) - len(got))
80+
while len(got) < len(client_preface):
81+
tmp = sock.recv(len(client_preface) - len(got))
82+
assert len(tmp) > 0, "unexpected EOF"
83+
got += tmp
8384

8485
assert got == client_preface, "client preface mismatch"
8586

0 commit comments

Comments
 (0)