22 """Read a JSON-RPC message from STREAM.
23 The decoded object is returned."""
27 line = stream.readline()
31 if line.startswith(b
"Content-Length:"):
32 line = line[15:].strip()
33 content_length = int(line)
35 log(
"IGNORED: <<<%s>>>" % line)
37 while len(data) < content_length:
38 new_data = stream.read(content_length - len(data))
40 result = json.loads(data)