Mercurial > vim
diff src/json.c @ 8655:1eb302bf2475 v7.4.1617
commit https://github.com/vim/vim/commit/ba61ac0d61f46de7d29c64bb0de6d25c2e378be0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 20 16:40:37 2016 +0100
patch 7.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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 20 Mar 2016 16:45:04 +0100 |
parents | c337c813c64d |
children | 7038ec89d1fd |
line wrap: on
line diff
--- a/src/json.c +++ b/src/json.c @@ -877,8 +877,9 @@ json_decode_all(js_read_T *reader, typva /* * 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 ret = json_decode_item(reader, res, options); json_skip_white(reader); - return ret == OK ? OK : FAIL; + return ret; } /*