ruby-changes:21597
From: akr <ko1@a...>
Date: Sun, 6 Nov 2011 14:51:54 +0900 (JST)
Subject: [ruby-changes:21597] akr:r33646 (trunk): * ext/socket/rubysocket.h (rsock_recvmsg): declared.
akr 2011-11-06 14:51:43 +0900 (Sun, 06 Nov 2011) New Revision: 33646 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33646 Log: * ext/socket/rubysocket.h (rsock_recvmsg): declared. * ext/socket/ancdata.c (rsock_recvmsg): extracted from nogvl_recvmsg_func. (nogvl_recvmsg_func): use rsock_recvmsg. Modified files: trunk/ChangeLog trunk/ext/socket/ancdata.c trunk/ext/socket/rubysocket.h trunk/ext/socket/unixsocket.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33645) +++ ChangeLog (revision 33646) @@ -1,3 +1,13 @@ +Sun Nov 6 14:49:58 2011 Tanaka Akira <akr@f...> + + * ext/socket/rubysocket.h (rsock_recvmsg): declared. + + * ext/socket/ancdata.c (rsock_recvmsg): extracted from + nogvl_recvmsg_func. + (nogvl_recvmsg_func): use rsock_recvmsg. + + * ext/socket/unixsocket.c (recvmsg_blocking): use rsock_recvmsg. + Sun Nov 06 03:22:36 2011 Martin Bosslet <Martin.Bosslet@g...> * test/openssl/test_engine.rb: add test for engine cipher. RC4 is used Index: ext/socket/rubysocket.h =================================================================== --- ext/socket/rubysocket.h (revision 33645) +++ ext/socket/rubysocket.h (revision 33646) @@ -282,6 +282,7 @@ #if defined(HAVE_RECVMSG) VALUE rsock_bsock_recvmsg(int argc, VALUE *argv, VALUE sock); VALUE rsock_bsock_recvmsg_nonblock(int argc, VALUE *argv, VALUE sock); +ssize_t rsock_recvmsg(int socket, struct msghdr *message, int flags); #else #define rsock_bsock_recvmsg rb_f_notimplement #define rsock_bsock_recvmsg_nonblock rb_f_notimplement Index: ext/socket/ancdata.c =================================================================== --- ext/socket/ancdata.c (revision 33645) +++ ext/socket/ancdata.c (revision 33646) @@ -1358,18 +1358,24 @@ int flags; }; -static VALUE -nogvl_recvmsg_func(void *ptr) +ssize_t +rsock_recvmsg(int socket, struct msghdr *message, int flags) { - struct recvmsg_args_struct *args = ptr; - int flags = args->flags; #ifdef MSG_CMSG_CLOEXEC /* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */ flags |= MSG_CMSG_CLOEXEC; #endif - return recvmsg(args->fd, args->msg, flags); + return recvmsg(socket, message, flags); } +static VALUE +nogvl_recvmsg_func(void *ptr) +{ + struct recvmsg_args_struct *args = ptr; + int flags = args->flags; + return rsock_recvmsg(args->fd, args->msg, flags); +} + static ssize_t rb_recvmsg(int fd, struct msghdr *msg, int flags) { Index: ext/socket/unixsocket.c =================================================================== --- ext/socket/unixsocket.c (revision 33645) +++ ext/socket/unixsocket.c (revision 33646) @@ -265,11 +265,7 @@ { struct iomsg_arg *arg = data; int flags = 0; -#ifdef MSG_CMSG_CLOEXEC - /* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */ - flags |= MSG_CMSG_CLOEXEC; -#endif - return recvmsg(arg->fd, &arg->msg, flags); + return rsock_recvmsg(arg->fd, &arg->msg, flags); } /* -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/