0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 7.4.1623

Problem:    All Channels share the message ID, it keeps getting bigger.
Solution:   Use a message ID per channel.
This commit is contained in:
Bram Moolenaar
2016-03-20 19:31:33 +01:00
parent 17b56c9f83
commit e9d6a298df
4 changed files with 5 additions and 14 deletions

View File

@@ -2294,17 +2294,6 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
return FAIL;
}
/*
* Return a unique ID to be used in a message.
*/
int
channel_get_id(void)
{
static int next_id = 1;
return next_id++;
}
/*
* Read from channel "channel" for as long as there is something to read.
* "part" is PART_SOCK, PART_OUT or PART_ERR.
@@ -2787,7 +2776,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
return;
}
id = channel_get_id();
id = ++channel->ch_last_msg_id;
text = json_encode_nr_expr(id, &argvars[1],
ch_mode == MODE_JS ? JSON_JS : 0);
if (text == NULL)