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-2391
Christian Decker 6 years ago
committed by neil saitug
parent
commit
e79fbb6812
  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