Kazunobu Kuriyama wrote:

> As shown above, on OS X, we got the error messages "Connection refused,"
> which correspond to ECONNREFUSED.
> 
> But I found the actual errno is EINPROGRESS; the errno value is overwritten
> at line 457.

Let's remove that.

> Actually, if line 457 is commented out, I got other error messages
> "Operation now in progress," which correspond to EINPROGRESS.
> 
> This indicates that, although we got the error messages from the block
> 456--462, the real cause of the error came from connect(), as select()
> won't set errno to EINPROGRESS.

So this means select() didn't wait as expected.  I suspect this is
because it also has the read status checked.  In the docs and examples I
find one should only check the write status.

> Reading the code at line 420 and below, we see that  the code doesn't
> consider it an error when the errno is set to EINPROGRESS even if connect()
> returns -1.
> 
> If EINPROGRESS is given a go like this, then wouldn't we have to wait for
> the socket to be connected like this? (for simplicity, timeout to avoid
> infinite loop is omitted):

No, connect() doesn't take a timeout, polling is not a good way to do
this.

I also notice the code uses select() even when connect() returned zero,
that is not right.

Also, when timing out there should be no error message, the caller
should handle this.

[...]
> But I saw this sort of error appeared in previous patches and soon
> disappeared at some point recently.  Isn't it possible to fix that in a
> similar way, though I'm not pretty sure how the previous issue was fixed.
> 
> I know little about the recent development of channel.  So if I miss the
> point and am wrong, sorry about disturbing you.

I'll change a few things, please try again after that patch.
It may require some debugging and trying to make this code portable.
It's the part that is new, it didn't exist in the netbeans code.

-- 
If Microsoft would build a car...
... the oil, water temperature, and alternator warning lights would
all be replaced by a single "General Protection Fault" warning light.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui