Mercurial > vim
comparison src/channel.c @ 9131:3507fde33e6e v7.4.1849
commit https://github.com/vim/vim/commit/5850a764eae74a4dae7238e4e76b4c24f062699b
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 27 19:59:48 2016 +0200
patch 7.4.1849
Problem: Still trying to read from channel that is going to be closed.
(Ramel Eshed)
Solution: Check if ch_to_be_closed is set.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 27 May 2016 20:00:07 +0200 |
parents | b430d4f2aa79 |
children | dec3b7b977c0 |
comparison
equal
deleted
inserted
replaced
9130:3924acee7349 | 9131:3507fde33e6e |
---|---|
2891 int len = 0; | 2891 int len = 0; |
2892 int readlen = 0; | 2892 int readlen = 0; |
2893 sock_T fd; | 2893 sock_T fd; |
2894 int use_socket = FALSE; | 2894 int use_socket = FALSE; |
2895 | 2895 |
2896 /* If we detected a read error don't try reading again. */ | |
2897 if (channel->ch_to_be_closed) | |
2898 return; | |
2899 | |
2896 fd = channel->ch_part[part].ch_fd; | 2900 fd = channel->ch_part[part].ch_fd; |
2897 if (fd == INVALID_FD) | 2901 if (fd == INVALID_FD) |
2898 { | 2902 { |
2899 ch_error(channel, "channel_read() called while socket is closed"); | 2903 ch_error(channel, "channel_read() called while socket is closed"); |
2900 return; | 2904 return; |
3191 int part; | 3195 int part; |
3192 sock_T fd; | 3196 sock_T fd; |
3193 | 3197 |
3194 for (channel = first_channel; channel != NULL; channel = channel->ch_next) | 3198 for (channel = first_channel; channel != NULL; channel = channel->ch_next) |
3195 { | 3199 { |
3200 /* If we detected a read error don't try reading again. */ | |
3201 if (channel->ch_to_be_closed) | |
3202 continue; | |
3203 | |
3196 /* check the socket and pipes */ | 3204 /* check the socket and pipes */ |
3197 for (part = PART_SOCK; part <= PART_ERR; ++part) | 3205 for (part = PART_SOCK; part <= PART_ERR; ++part) |
3198 { | 3206 { |
3199 fd = channel->ch_part[part].ch_fd; | 3207 fd = channel->ch_part[part].ch_fd; |
3200 if (fd != INVALID_FD) | 3208 if (fd != INVALID_FD) |