Mercurial > vim
comparison src/channel.c @ 10553:f83b6a0b6148 v8.0.0166
patch 8.0.0166: JSON with a duplicate key gives an internal error
commit https://github.com/vim/vim/commit/03c60c1573cdbebbb662863cfc1780d19d511db5
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 10 15:15:37 2017 +0100
patch 8.0.0166: JSON with a duplicate key gives an internal error
Problem: JSON with a duplicate key gives an internal error. (Lcd)
Solution: Give a normal error. Avoid an error when parsing JSON from a
remote client fails.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 10 Jan 2017 15:30:05 +0100 |
parents | ea7fbae33285 |
children | 98ee4f22da6e |
comparison
equal
deleted
inserted
replaced
10552:fb7cdd106c9b | 10553:f83b6a0b6148 |
---|---|
1894 reader.js_cookie = channel; | 1894 reader.js_cookie = channel; |
1895 reader.js_cookie_arg = part; | 1895 reader.js_cookie_arg = part; |
1896 | 1896 |
1897 /* When a message is incomplete we wait for a short while for more to | 1897 /* When a message is incomplete we wait for a short while for more to |
1898 * arrive. After the delay drop the input, otherwise a truncated string | 1898 * arrive. After the delay drop the input, otherwise a truncated string |
1899 * or list will make us hang. */ | 1899 * or list will make us hang. |
1900 * Do not generate error messages, they will be written in a channel log. */ | |
1901 ++emsg_silent; | |
1900 status = json_decode(&reader, &listtv, | 1902 status = json_decode(&reader, &listtv, |
1901 chanpart->ch_mode == MODE_JS ? JSON_JS : 0); | 1903 chanpart->ch_mode == MODE_JS ? JSON_JS : 0); |
1904 --emsg_silent; | |
1902 if (status == OK) | 1905 if (status == OK) |
1903 { | 1906 { |
1904 /* Only accept the response when it is a list with at least two | 1907 /* Only accept the response when it is a list with at least two |
1905 * items. */ | 1908 * items. */ |
1906 if (listtv.v_type != VAR_LIST || listtv.vval.v_list->lv_len < 2) | 1909 if (listtv.v_type != VAR_LIST || listtv.vval.v_list->lv_len < 2) |