[前][次][番号順一覧][スレッド一覧]

ruby-changes:33013

From: usa <ko1@a...>
Date: Sat, 22 Feb 2014 09:53:29 +0900 (JST)
Subject: [ruby-changes:33013] usa:r45092 (ruby_1_9_3): merge revision(s) 45084: [Backport #9547]

usa	2014-02-22 09:52:54 +0900 (Sat, 22 Feb 2014)

  New Revision: 45092

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

  Log:
    merge revision(s) 45084: [Backport #9547]
    
    * 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]

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/socket/init.c
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 45091)
+++ ruby_1_9_3/ChangeLog	(revision 45092)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Sat Feb 22 09:51:53 2014  Shugo Maeda  <shugo@r...>
+
+	* 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@r...>
 
 	* class.c (rb_mod_init_copy): do nothing if copying self.
Index: ruby_1_9_3/ext/socket/init.c
===================================================================
--- ruby_1_9_3/ext/socket/init.c	(revision 45091)
+++ ruby_1_9_3/ext/socket/init.c	(revision 45092)
@@ -281,8 +281,12 @@ wait_connectable(int fd) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ext/socket/init.c#L281
 	     */
 	    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;
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 45091)
+++ ruby_1_9_3/version.h	(revision 45092)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #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

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45084


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]