mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
lightning.py: parse multiple JSON RPC commands accurately.
We need to keep the remaining buffer, and we need to try to parse it before we read the next. I first tried keeping it in the object, but its lifetime is that of the *socket*, which we actually reopen for every command. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
fe11ee5406
commit
0c3f85d931
@@ -611,8 +611,9 @@ def test_multirpc(node_factory):
|
||||
|
||||
sock.sendall(b'\n'.join(commands))
|
||||
|
||||
buff = b''
|
||||
for i in commands:
|
||||
l1.rpc._readobj(sock)
|
||||
_, buff = l1.rpc._readobj(sock, buff)
|
||||
sock.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user