1
0
forked from aniani/vim

patch 7.4.1238

Problem:    Can't handle two messages right after each other.
Solution:   Find the end of the JSON.  Read more when incomplete.  Add a C
            test for the JSON decoding.
This commit is contained in:
Bram Moolenaar
2016-02-02 18:20:08 +01:00
parent d9ea9069f5
commit 56ead341a7
9 changed files with 535 additions and 140 deletions

View File

@@ -540,9 +540,8 @@ channel_read_json(int ch_idx)
/* TODO: make reader work properly */
/* reader.js_buf = channel_peek(ch_idx); */
reader.js_buf = channel_get_all(ch_idx);
reader.js_eof = TRUE;
/* reader.js_eof = FALSE; */
reader.js_used = 0;
reader.js_fill = NULL;
/* reader.js_fill = channel_fill; */
reader.js_cookie = &ch_idx;
if (json_decode(&reader, &listtv) == OK)