summaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-20 16:40:37 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-20 16:40:37 +0100
commitba61ac0d61f46de7d29c64bb0de6d25c2e378be0 (patch)
tree73b207b09bb0d57e5a9cf4f80cd514fbace293fd /src/json.c
parentac74d5e86cd16b42e81ba48f58f3d45c72758248 (diff)
downloadvim-git-ba61ac0d61f46de7d29c64bb0de6d25c2e378be0.tar.gz
patch 7.4.1617v7.4.1617
Problem: When a JSON message is split it isn't decoded. Solution: Wait a short time for the rest of the message to arrive.
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c
index cd80a761e..9738fc5fe 100644
--- a/src/json.c
+++ b/src/json.c
@@ -877,8 +877,9 @@ json_decode_all(js_read_T *reader, typval_T *res, int options)
/*
* Decode the JSON from "reader" and store the result in "res".
* "options" can be JSON_JS or zero;
- * Return FAIL if the message has a decoding error or the message is
- * truncated. Consumes the message anyway.
+ * Return FAIL for a decoding error.
+ * Return MAYBE for an incomplete message.
+ * Consumes the message anyway.
*/
int
json_decode(js_read_T *reader, typval_T *res, int options)
@@ -891,7 +892,7 @@ json_decode(js_read_T *reader, typval_T *res, int options)
ret = json_decode_item(reader, res, options);
json_skip_white(reader);
- return ret == OK ? OK : FAIL;
+ return ret;
}
/*