patch 7.4.1616
Problem: Malformed channel request causes a hang.
Solution: Drop malformed message. (Damien)
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py
index a465d65..47a12ea 100644
--- a/src/testdir/test_channel.py
+++ b/src/testdir/test_channel.py
@@ -104,6 +104,11 @@
print("sending: {}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
+ elif decoded[1] == 'malformed':
+ cmd = '["ex",":"]wrong!["ex","smi"]'
+ print("sending: {}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
elif decoded[1] == 'an expr':
# Send an expr request.
cmd = '["expr","setline(\\"$\\", [\\"one\\",\\"two\\",\\"three\\"])"]'
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 6d38bff..c628bbe 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -123,10 +123,12 @@
" check that no job is handled correctly
call assert_equal('no process', string(ch_getjob(handle)))
endif
-
" Simple string request and reply.
call assert_equal('got it', ch_evalexpr(handle, 'hello!'))
+ " Malformed command should be ignored.
+ call assert_equal('ok', ch_evalexpr(handle, 'malformed'))
+
" Request that triggers sending two ex commands. These will usually be
" handled before getting the response, but it's not guaranteed, thus wait a
" tiny bit for the commands to get executed.