0
0
mirror of https://github.com/vim/vim.git synced 2025-09-06 21:53:38 -04:00

patch 7.4.1252

Problem:    The channel test server may receive two messages concatenated.
Solution:   Split the messages.
This commit is contained in:
Bram Moolenaar 2016-02-03 22:20:29 +01:00
parent bf087cead9
commit e7bed627c8
2 changed files with 61 additions and 46 deletions

View File

@ -45,8 +45,21 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("=== socket closed ===")
break
print("received: {}".format(data))
# We may receive two messages at once. Take the part up to the
# matching "]" (recognized by finding "][").
while data != '':
splitidx = data.find('][')
if splitidx < 0:
todo = data
data = ''
else:
todo = data[:splitidx + 1]
data = data[splitidx + 1:]
print("using: {}".format(todo))
try:
decoded = json.loads(data)
decoded = json.loads(todo)
except ValueError:
print("json decoding failed")
decoded = [-1, '']

View File

@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1252,
/**/
1251,
/**/