Kaydet (Commit) 7107e265 authored tarafından Joffrey F's avatar Joffrey F Kaydeden (comit) Joffrey F

Do not interrupt streaming when encountering 0-length frames

Signed-off-by: 's avatarJoffrey F <joffrey@docker.com>
üst a49d73e9
......@@ -59,7 +59,7 @@ def next_frame_size(socket):
try:
data = read_exactly(socket, 8)
except SocketError:
return 0
return -1
_, actual = struct.unpack('>BxxxL', data)
return actual
......@@ -71,7 +71,7 @@ def frames_iter(socket):
"""
while True:
n = next_frame_size(socket)
if n == 0:
if n < 0:
break
while n > 0:
result = read(socket, n)
......
......@@ -205,7 +205,9 @@ def get_fake_wait():
def get_fake_logs():
status_code = 200
response = (b'\x01\x00\x00\x00\x00\x00\x00\x11Flowering Nights\n'
response = (b'\x01\x00\x00\x00\x00\x00\x00\x00'
b'\x02\x00\x00\x00\x00\x00\x00\x00'
b'\x01\x00\x00\x00\x00\x00\x00\x11Flowering Nights\n'
b'\x01\x00\x00\x00\x00\x00\x00\x10(Sakuya Iyazoi)\n')
return status_code, response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment