Hi mattn,
2016/2/4 Thu 9:16:22 UTC+9 mattn wrote:
> On Wednesday, February 3, 2016 at 8:43:53 PM UTC+9, Ken Takata wrote:
> > Hi mattn,
> >
> > 2016/2/3 Wed 20:24:02 UTC+9 mattn wrote:
> > > On Wednesday, February 3, 2016 at 7:47:18 PM UTC+9, Ken Takata wrote:
> > > > Hi,
> > > >
> > > > I found some problems with the channel feature. (v7.4.1246)
> > > >
> > > > 1. On Win32 GUI, vim hangs up.
> > > >
> > > > :let handle = ch_open('localhost:8765', 'json')
> > > > :echo ch_sendexpr(handle, 'hello!')
> > > > Vim hangs up.
> > > >
> > > > Or,
> > > >
> > > > :let handle = ch_open('localhost:8765', 'json')
> > > > :quit
> > > > Vim hangs up.
> > > >
> > > > The following patch seems to fix this:
> > > >
> > > > --- 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
> > > >
> > > > I'm not sure this is enough.
> > > > Maybe returning an error code in channel_read() is better?
> > >
> > > Strange. Win32 GUI doesn't require HAVE_SELECT_H because it works with
> > > using WSAAsyncSelect() as same as select(2). In the first place, the
> > > first patch 7.4.1191 doesn't define HAVE_SELECT_H for windows GUI/CUI.
> > > but it worked. I'm guessing there is something another issue.
> >
> > The hangup occurs in channel_read_json_block() which was added by 7.4.1231.
> > 7.4.1191 is too old. ;-)
> >
> > channel_wait() always returns OK when HAVE_SELECT_H is not defined, and it
> > cause an infinite loop.
>
> Could you please show me the way to reproduce?
>
> GUI has implementation for selecting in asynchronized. So when calling
> channel_read_json_block(), data is arrived in the socket. I beleave, that
> channel_wait() always return OK doesn't matter. And I doubt using both API
> WSAAsyncSelect() and select() may occur problem.
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.
(The problem #2 still occurs.)
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.