Hi Bram and mattn,
2016/2/4 Thu 9:38:19 UTC+9 Ken Takata wrote:
> Hmm, I tried with 7.4.1256 and the problem #1 was not reproduced...
> I don't know there was a related patch in the last 10 patches,
> but my patch to vim.h doesn't seem to be needed now.
It seems that this was fixed with 7.4.1249.
> (The problem #2 still occurs.)
The problem with Win32 GUI seems to be fixed by the attached patch.
(Moving "!defined(FEAT_GUI_W32)" from vim.h to channel.c is optional.)
However, with or without my patch, using callback causes a crash both on
Windows and Linux (7.4.1256):
let handle = ch_open('localhost:8765', 'json')
func MyHandler(handle, msg)
echo "from the handler: " . a:msg
endfunc
call ch_sendexpr(handle, 'hello!', "MyHandler")
Wait about 10 sec, then vim crashes.
It seems that 7.4.1246 caused the regression.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent e69d7d38656a700b0acec490176982a5eb9baf1d
diff --git a/src/channel.c b/src/channel.c
--- a/src/channel.c
+++ b/src/channel.c
@@ -958,7 +958,7 @@ channel_clear(int idx)
static int
channel_wait(int fd, int timeout)
{
-#ifdef HAVE_SELECT
+#if defined(HAVE_SELECT) && !defined(FEAT_GUI_W32)
struct timeval tval;
fd_set rfds;
int ret;
@@ -1045,6 +1045,13 @@ channel_read(int idx)
if (len < MAXMSGSIZE)
break; /* did read everything that's available */
}
+#ifdef FEAT_GUI_W32
+ if (len == SOCKET_ERROR)
+ {
+ if (WSAGetLastError() == WSAEWOULDBLOCK)
+ return;
+ }
+#endif
/* Reading a socket disconnection (readlen == 0), or a socket error. */
if (readlen <= 0)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -6,13 +6,13 @@ if !has('channel')
endif
" This test requires the Python command to run the test server.
-" This most likely only works on Unix and Windows console.
+" This most likely only works on Unix and Windows.
if has('unix')
" We also need the pkill command to make sure the server can be stopped.
if !executable('python') || !executable('pkill')
finish
endif
-elseif has('win32') && !has('gui_win32')
+elseif has('win32')
" Use Python Launcher for Windows (py.exe).
if !executable('py')
finish
diff --git a/src/vim.h b/src/vim.h
--- a/src/vim.h
+++ b/src/vim.h
@@ -549,7 +549,7 @@ typedef unsigned long u8char_T; /* l
# ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
# define HAVE_POLL
-# elif defined(WIN32) && !defined(FEAT_GUI_W32)
+# elif defined(WIN32)
# define HAVE_SELECT
# else
# ifdef HAVE_POLL_H