Skip to content

Commit bf37857

Browse files
committed
merge revision(s) 45084: [Backport ruby#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 ruby#9547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@45092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 88a1065 commit bf37857

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Sat Feb 22 09:51:53 2014 Shugo Maeda <shugo@ruby-lang.org>
2+
3+
* ext/socket/init.c (wait_connectable): break if the socket is
4+
writable to avoid infinite loops on FreeBSD and other platforms
5+
which conforms to SUSv3. This problem cannot be reproduced with
6+
loopback interfaces, so it's hard to write test code.
7+
rsock_connect() and wait_connectable() are overly complicated, so
8+
they should be refactored, but I commit this fix as a workaround
9+
for the release of Ruby 1.9.3 scheduled on Feb 24.
10+
[ruby-core:60940] [Bug #9547]
11+
112
Sat Feb 22 09:26:05 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
213

314
* class.c (rb_mod_init_copy): do nothing if copying self.

ext/socket/init.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,12 @@ wait_connectable(int fd)
281281
*/
282282
if (ret < 0)
283283
break;
284-
if (sockerr == 0)
285-
continue; /* workaround for winsock */
284+
if (sockerr == 0) {
285+
if (revents & RB_WAITFD_OUT)
286+
break;
287+
else
288+
continue; /* workaround for winsock */
289+
}
286290

287291
/* BSD and Linux use sockerr. */
288292
errno = sockerr;

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.3"
2-
#define RUBY_PATCHLEVEL 538
2+
#define RUBY_PATCHLEVEL 539
33

44
#define RUBY_RELEASE_DATE "2014-02-22"
55
#define RUBY_RELEASE_YEAR 2014

0 commit comments

Comments
 (0)