Mercurial > vim
changeset 28347:d6892ed619e0 v8.2.4699
patch 8.2.4699: hard to reproduce hang when reading from a channel
Commit: https://github.com/vim/vim/commit/75a0f3c011dfbafd2d60e87d4b2b07572df3e3ec
Author: LemonBoy <thatlemon@gmail.com>
Date: Tue Apr 5 22:03:30 2022 +0100
patch 8.2.4699: hard to reproduce hang when reading from a channel
Problem: Hard to reproduce hang when reading from a channel.
Solution: Check for readahead before starting to wait. (closes https://github.com/vim/vim/issues/10093,
closes #7781, closes #6364)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 Apr 2022 23:15:02 +0200 |
parents | e080546fb0f8 |
children | b686979c523d |
files | src/channel.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/channel.c +++ b/src/channel.c @@ -3997,6 +3997,11 @@ channel_read_json_block( if (channel_parse_messages()) continue; + // channel_parse_messages() may fill the queue with new data to + // process. + if (channel_has_readahead(channel, part)) + continue; + // Wait for up to the timeout. If there was an incomplete message // use the deadline for that. timeout = timeout_arg;