Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[ruby-dev:28861] test_accept_nonblock(TestNonblockSocket) and test_connect_: msg#00185

lang.ruby.devel

Subject: [ruby-dev:28861] test_accept_nonblock(TestNonblockSocket) and test_connect_nonblock(TestNonblockSocket) failure

(ArgumentError で止まっているので boron の chkbuild には出て
きていませんが) 以下のような失敗が起きています。

% ./ruby -v
ruby 1.9.0 (2006-06-25) [i686-linux]
% ./ruby test/runner.rb test/socket/test_nonblock.rb
Loaded suite test_nonblock.rb
Started
FF.....
Finished in 0.020617 seconds.

1) Failure:
test_accept_nonblock(TestNonblockSocket)
[/tmp/19/ruby/test/socket/test_nonblock.rb:18]:
<"\002\000\2254\177\000\000\001\000\000\000\000\000\000\000\000"> expected but
was
<"\002\000\000\000\177\000\000\001\200\330\347\267\034\000\000\000X\263\317\277\000\000\000...\277\001\000\000\000">.

2) Failure:
test_connect_nonblock(TestNonblockSocket)
[/tmp/19/ruby/test/socket/test_nonblock.rb:43]:
<"\002\000\273\205\177\000\000\001\000\000\000\000\000\000\000\000"> expected
but was
<"\000\000\000\000\004\000\000\000@\277\312\267\377\377\377\377\024\265\317\277\000\000\000...\347\267@\000\000\000">.

7 tests, 29 assertions, 2 failures, 0 errors

以前は問題なかったはずだ、と思って調べてみると、件の大きなコ
ミットの socket.c の変更
http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/socket/socket.c.diff?r1=1.170;r2=1.171
の中の以下の変更のようです。

@@ -2948,18 +2824,15 @@ sock_recvfrom_nonblock(int argc, VALUE *
}

static VALUE
-sock_accept(sock)
- VALUE sock;
+sock_accept(VALUE sock)
{
OpenFile *fptr;
- VALUE sock2;
char buf[1024];
socklen_t len = sizeof buf;

GetOpenFile(sock, fptr);
- sock2 = s_accept(rb_cSocket,fptr->fd,(struct sockaddr*)buf,&len);
-
- return rb_assoc_new(sock2, rb_str_new(buf, len));
+ return rb_assoc_new(s_accept(rb_cSocket,fptr->fd,(struct sockaddr*)buf,
&len),
+ rb_str_new(buf, len));
}

/*
@@ -3011,17 +2884,16 @@ sock_accept(sock)
* * Socket#accept
*/
static VALUE
-sock_accept_nonblock(sock)
- VALUE sock;
+sock_accept_nonblock(VALUE sock)
{
OpenFile *fptr;
- VALUE sock2;
char buf[1024];
socklen_t len = sizeof buf;

GetOpenFile(sock, fptr);
- sock2 = s_accept_nonblock(rb_cSocket, fptr, (struct sockaddr *)buf, &len);
- return rb_assoc_new(sock2, rb_str_new(buf, len));
+ return rb_assoc_new(s_accept_nonblock(rb_cSocket, fptr,
+ (struct sockaddr *)buf, &len),
+ rb_str_new(buf, len));
}

/*

ISO にのりこんで C の引数の評価順序を左から右に決めさせる、
というんでなければ、これは revert が適当ではないかと思います。
--
[田中 哲][たなか あきら][Tanaka Akira]




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation