diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-22 23:01:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-22 23:01:40 +0100 |
commit | 31faed60bfd54ff8f612f6b311a6cbcd9e7ebedd (patch) | |
tree | de12ca4fda2ff96c452f2011c91a81a9e24d58f3 /src/channel.c | |
parent | f88af6e6757b2e373cf6cd366d6a81a066a6ade0 (diff) |
patch 8.1.0796: MS-Windows 7: problem with named pipe on channelv8.1.0796
Problem: MS-Windows 7: problem with named pipe on channel.
Solution: Put back the disconnect/connect calls. (Yasuhiro Matsumoto,
closes #3833)
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c index 41d19f51ed..3a80748a12 100644 --- a/src/channel.c +++ b/src/channel.c @@ -3181,7 +3181,13 @@ channel_wait(channel_T *channel, sock_T fd, int timeout) if (r && nread > 0) return CW_READY; - if (r == 0) + + if (channel->ch_named_pipe) + { + DisconnectNamedPipe((HANDLE)fd); + ConnectNamedPipe((HANDLE)fd, NULL); + } + else if (r == 0) return CW_ERROR; /* perhaps write some buffer lines */ @@ -3813,7 +3819,16 @@ channel_send( if (part == PART_SOCK) res = sock_write(fd, (char *)buf, len); else + { res = fd_write(fd, (char *)buf, len); +#ifdef WIN32 + if (channel->ch_named_pipe && res < 0) + { + DisconnectNamedPipe((HANDLE)fd); + ConnectNamedPipe((HANDLE)fd, NULL); + } +#endif + } if (res < 0 && (errno == EWOULDBLOCK #ifdef EAGAIN || errno == EAGAIN |