Browse Source

pylightning: Fix missing encode if first pass fails

Without this the RPC will fail to continue buffering if the response does not
fit in the first read, and if we don't switch over to the non-compat
mode. This was introduced by our mitigation of the UTF-8 misalignment, but I
missed this path.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
pr-2355-addendum
Christian Decker 6 years ago
parent
commit
55d59afe81
No known key found for this signature in database GPG Key ID: 1416D83DC4F0E86D
  1. 2
      contrib/pylightning/lightning/lightning.py

2
contrib/pylightning/lightning/lightning.py

@ -160,7 +160,7 @@ class UnixDomainSocketRpc(object):
return objs, buff
except ValueError:
# Probably didn't read enough
pass
buff = buff.lstrip().encode("UTF-8")
def _readobj(self, sock, buff=b''):
"""Read a JSON object, starting with buff; returns object and any buffer left over"""

Loading…
Cancel
Save