mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Properly handle EOF.
This commit is contained in:
parent
f98cbb1616
commit
f72fb31d1e
1 changed files with 6 additions and 0 deletions
|
|
@ -16,6 +16,12 @@ def read(stream, look_up=look_up):
|
|||
except ValueError:
|
||||
raise RuntimeError('invalid header line: {}'.format(line))
|
||||
headers[name] = value
|
||||
else:
|
||||
# EOF
|
||||
return None
|
||||
|
||||
if not headers:
|
||||
raise RuntimeError('got message without headers')
|
||||
|
||||
size = int(headers['Content-Length'])
|
||||
body = stream.read(size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue