Skip to content
Myr

Merge pull request #3631 from lovedboy/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

little modification in consume_socket_content

authored by Cory Benfield · committed by GitHub · parents 83fcabc, d587533 · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • tests:+5 added−5 removed

1 file+5 added−5 removed

modified:tests/testserver/server.py+5 added-5 removed
6 unmodified lines
78def consume_socket_content(sock, timeout=0.5):9 chunks = 6553610 content = b''11 more_to_read = select.select([sock], [], [], timeout)[0]1113 while more_to_read:14 new_content = sock.recv(chunks)12 while True:13 more_to_read = select.select([sock], [], [], timeout)[0]14 if not more_to_read:15 break1617 new_content = sock.recv(chunks)18 if not new_content:19 break2021 content += new_content20 # stop reading if no new data is received for a while21 more_to_read = select.select([sock], [], [], timeout)[0]2223 return content2425
102 unmodified lines