mirror of
https://github.com/vim/vim.git
synced 2025-09-13 23:04:24 -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 ===")
|
print("=== socket closed ===")
|
||||||
break
|
break
|
||||||
print("received: {}".format(data))
|
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:
|
try:
|
||||||
decoded = json.loads(data)
|
decoded = json.loads(todo)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("json decoding failed")
|
print("json decoding failed")
|
||||||
decoded = [-1, '']
|
decoded = [-1, '']
|
||||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1252,
|
||||||
/**/
|
/**/
|
||||||
1251,
|
1251,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user