Mercurial > vim
comparison src/channel.c @ 8261:a412b466bedc v7.4.1423
commit https://github.com/vim/vim/commit/4cafa6dc7f0728b018979aff0ca039908ecf2ae1
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 26 11:52:39 2016 +0100
patch 7.4.1423
Problem: Channel test fails on MS-Windows.
Solution: Do not give an error message when reading fails, assume the other
end exited.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 26 Feb 2016 12:00:05 +0100 |
parents | 99a70c3b902f |
children | 108d30ed34ba |
comparison
equal
deleted
inserted
replaced
8260:a61da15cb3f3 | 8261:a412b466bedc |
---|---|
1761 readlen += len; | 1761 readlen += len; |
1762 if (len < MAXMSGSIZE) | 1762 if (len < MAXMSGSIZE) |
1763 break; /* did read everything that's available */ | 1763 break; /* did read everything that's available */ |
1764 } | 1764 } |
1765 | 1765 |
1766 /* Reading a disconnection (readlen == 0), or an error. | 1766 /* Reading a disconnection (readlen == 0), or an error. */ |
1767 * TODO: call error callback. */ | |
1768 if (readlen <= 0) | 1767 if (readlen <= 0) |
1769 { | 1768 { |
1769 /* Do not give an error message, most likely the other end just | |
1770 * exited. */ | |
1771 ch_errors(channel, "%s(): Cannot read from channel", func); | |
1772 | |
1770 /* Queue a "DETACH" netbeans message in the command queue in order to | 1773 /* Queue a "DETACH" netbeans message in the command queue in order to |
1771 * terminate the netbeans session later. Do not end the session here | 1774 * terminate the netbeans session later. Do not end the session here |
1772 * directly as we may be running in the context of a call to | 1775 * directly as we may be running in the context of a call to |
1773 * netbeans_parse_messages(): | 1776 * netbeans_parse_messages(): |
1774 * netbeans_parse_messages | 1777 * netbeans_parse_messages |
1775 * -> autocmd triggered while processing the netbeans cmd | 1778 * -> autocmd triggered while processing the netbeans cmd |
1776 * -> ui_breakcheck | 1779 * -> ui_breakcheck |
1777 * -> gui event loop or select loop | 1780 * -> gui event loop or select loop |
1778 * -> channel_read() | 1781 * -> channel_read() |
1779 */ | 1782 */ |
1780 ch_errors(channel, "%s(): Cannot read", func); | |
1781 if (len < 0) | |
1782 { | |
1783 ch_error(channel, "channel_read(): cannot read from channel"); | |
1784 PERROR(_("E896: read from channel")); | |
1785 } | |
1786 | |
1787 msg = channel->ch_part[part].ch_mode == MODE_RAW | 1783 msg = channel->ch_part[part].ch_mode == MODE_RAW |
1788 || channel->ch_part[part].ch_mode == MODE_NL | 1784 || channel->ch_part[part].ch_mode == MODE_NL |
1789 ? DETACH_MSG_RAW : DETACH_MSG_JSON; | 1785 ? DETACH_MSG_RAW : DETACH_MSG_JSON; |
1790 channel_save(channel, part, (char_u *)msg, (int)STRLEN(msg)); | 1786 channel_save(channel, part, (char_u *)msg, (int)STRLEN(msg)); |
1791 | 1787 |