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:
parent
bf087cead9
commit
e7bed627c8
@ -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, '']
|
||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1252,
|
||||
/**/
|
||||
1251,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user