[ruby-cvs:54765] normal:r47617 (trunk): socket (rsock_connect): fix and refactor for blocking

normal at ruby-lang.org normal at ruby-lang.org
Thu Sep 18 06:21:00 JST 2014


normal	2014-09-18 06:20:58 +0900 (Thu, 18 Sep 2014)

  New Revision: 47617

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47617

  Log:
    socket (rsock_connect): fix and refactor for blocking
    
    * ext/socket/init.c (rsock_connect): refactor for blocking
      (wait_connectable): clear error before wait
      [Bug #9356]
    
    We no longer use non-blocking sockets to emulate blocking behavior,
    so eliminate error-prone and confusing platform-dependent code.
    According to POSIX, connect() only needs to be called once in the
    face of EINTR, so do not loop on it.
    
    Before waiting on connect, drop any pending errors, since
    rb_wait_for_single_fd may not clear the existing error
    properly.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/init.c


More information about the ruby-cvs mailing list