diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-05 22:03:30 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-05 22:03:30 +0100 |
commit | 75a0f3c011dfbafd2d60e87d4b2b07572df3e3ec (patch) | |
tree | 7c16ad5e0807724f07b1f317676e38bd111daa6b /src/channel.c | |
parent | aa7d0c233532fb9d8c2876ea8e978a82b12c377f (diff) |
patch 8.2.4699: hard to reproduce hang when reading from a channelv8.2.4699
Problem: Hard to reproduce hang when reading from a channel.
Solution: Check for readahead before starting to wait. (closes #10093,
closes #7781, closes #6364)
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c index 75fc89560c..f8a8194374 100644 --- 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; |