Ozaki Kiichi wrote: > I report some concerns about channel_open(). > > 1) https://github.com/vim/vim/blob/0f526f5/src/channel.c#L684 (On OS X) > > When "FD_ISSET(sd, &rfds) && FD_ISSET(sd, &wfds)" is satisfied, "ret" > is 2, thus this if-block is never used. > But removing "ret == 0" (or replacing by "ret == 2"), when we try to > connect to local port which is not listening, we go into if-block and > it returns NULL. > As a result, "waittime" is ignored (unlike other *nix environment), so > Test_open_delay fails.
Are you saying that the Mac-specific code here is not working as expected? We could just remove that. > 2) https://github.com/vim/vim/blob/0f526f5/src/channel.c#L686 > > Originally, according to the following, this behavior "encounter of > errors cause a socket to be both readable and writeable" is derived > from 4.4BSD implementations. > > Refs: Unix Networking Programming > https://books.google.co.jp/books?id=ptSC4LpwGA0C&pg=PA449&lpg=PA449&dq=tcp+socket+writable+on+error&source=bl&ots=Kr5DRiimUu&sig=LPaFAJzjQUN4Cmhp-VCLsvVmApM&hl=en&sa=X&ei=EYLcUM3wO9HW0gGb44GABw&redir_esc=y#v=onepage&q=tcp%20socket%20writable%20on%20error&f=false > > (and this book mentions that TCP/IP illustrated vol.2 describes about > such behavior; but I forgot where it is, sorry..) > > It appears that other *nix environments behave in the same way. > > But not vice versa, so we need check socket error by getsockopt() when > socket is both readable and writeable after connect(). > > > patch: > > https://gist.github.com/ichizok/e68a5b850df8362a0dbb I'll try it out later. -- BEDEVERE: Stand by for attack!! [CUT TO enormous army forming up. Trebuchets, rows of PIKEMEN, siege towers, pennants flying, shouts of "Stand by for attack!" Traditional army build-up shots. The shouts echo across the ranks of the army. We see various groups reacting, and stirring themselves in readiness.] ARTHUR: Who are they? BEDEVERE: Oh, just some friends! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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.
