Skip to content

Commit

Permalink
merge revision(s) 45084: [Backport #9547]
Browse files Browse the repository at this point in the history
	* ext/socket/init.c (wait_connectable): break if the socket is
	  writable to avoid infinite loops on FreeBSD and other platforms
	  which conforms to SUSv3.  This problem cannot be reproduced with
	  loopback interfaces, so it's hard to write test code.
	  rsock_connect() and wait_connectable() are overly complicated, so
	  they should be refactored, but I commit this fix as a workaround
	  for the release of Ruby 1.9.3 scheduled on Feb 24.
	  [ruby-core:60940] [Bug #9547]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@45092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Feb 22, 2014
1 parent 9e11c02 commit 27ca367
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
@@ -1,3 +1,14 @@
Sat Feb 22 09:51:53 2014 Shugo Maeda <shugo@ruby-lang.org>

* ext/socket/init.c (wait_connectable): break if the socket is
writable to avoid infinite loops on FreeBSD and other platforms
which conforms to SUSv3. This problem cannot be reproduced with
loopback interfaces, so it's hard to write test code.
rsock_connect() and wait_connectable() are overly complicated, so
they should be refactored, but I commit this fix as a workaround
for the release of Ruby 1.9.3 scheduled on Feb 24.
[ruby-core:60940] [Bug #9547]

Sat Feb 22 09:26:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>

* class.c (rb_mod_init_copy): do nothing if copying self.
Expand Down
8 changes: 6 additions & 2 deletions ext/socket/init.c
Expand Up @@ -281,8 +281,12 @@ wait_connectable(int fd)
*/
if (ret < 0)
break;
if (sockerr == 0)
continue; /* workaround for winsock */
if (sockerr == 0) {
if (revents & RB_WAITFD_OUT)
break;
else
continue; /* workaround for winsock */
}

/* BSD and Linux use sockerr. */
errno = sockerr;
Expand Down
2 changes: 1 addition & 1 deletion version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
#define RUBY_PATCHLEVEL 538
#define RUBY_PATCHLEVEL 539

#define RUBY_RELEASE_DATE "2014-02-22"
#define RUBY_RELEASE_YEAR 2014
Expand Down

0 comments on commit 27ca367

Please sign in to comment.