summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.py
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-05 22:49:56 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-05 22:49:56 +0100
commit6076fe1986255d32b7a078a28bf9e7bea19d6f30 (patch)
treedaf55b7116c9367fd61f9b3b9c00a95067b896e6 /src/testdir/test_channel.py
parent4d919d748e4e435edb135aa5ccf6ee7de9212023 (diff)
downloadvim-git-6076fe1986255d32b7a078a28bf9e7bea19d6f30.tar.gz
patch 7.4.1264v7.4.1264
Problem: Crash when receiving an empty array. Solution: Check for array with wrong number of arguments. (Damien)
Diffstat (limited to 'src/testdir/test_channel.py')
-rw-r--r--src/testdir/test_channel.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py
index fb75938c1..66b8c5e66 100644
--- a/src/testdir/test_channel.py
+++ b/src/testdir/test_channel.py
@@ -93,6 +93,11 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = "ok"
+ elif decoded[1] == 'empty-request':
+ cmd = '[]'
+ print("sending: {}".format(cmd))
+ self.request.sendall(cmd.encode('utf-8'))
+ response = "ok"
elif decoded[1] == 'eval-result':
# Send back the last received eval result.
response = last_eval
@@ -123,11 +128,9 @@ if __name__ == "__main__":
server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
ip, port = server.server_address
- # Start a thread with the server -- that thread will then start one
- # more thread for each request
+ # Start a thread with the server. That thread will then start a new thread
+ # for each connection.
server_thread = threading.Thread(target=server.serve_forever)
-
- # Exit the server thread when the main thread terminates
server_thread.start()
# Write the port number in Xportnr, so that the test knows it.