patch 8.0.0312: failure when a channel receives a split json message
Problem: When a json message arrives in pieces, the start is dropped and
the decoding fails.
Solution: Do not drop the start when it is still needed. (Kay Zheng) Add a
test. Reset the timeout when something is received.
diff --git a/src/testdir/test_channel_pipe.py b/src/testdir/test_channel_pipe.py
index 639cc6c..a67a81a 100644
--- a/src/testdir/test_channel_pipe.py
+++ b/src/testdir/test_channel_pipe.py
@@ -29,6 +29,11 @@
if typed.startswith("echo "):
print(typed[5:-1])
sys.stdout.flush()
+ if typed.startswith("echosplit "):
+ for part in typed[10:-1].split('|'):
+ sys.stdout.write(part)
+ sys.stdout.flush()
+ time.sleep(0.05)
if typed.startswith("double "):
print(typed[7:-1] + "\nAND " + typed[7:-1])
sys.stdout.flush()