summaryrefslogtreecommitdiff
path: root/test/socket
AgeCommit message (Collapse)Author
2009-07-19Use UDP for sendmsg/recvmsg tests.akr
sendmsg/recvmsg doesn't work with SOCK_STREAM on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19* test_socket.rb (test_udp_server): cannot check the existance of sendmsg byusa
respond_to?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17fix skip condition.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 * ext/socket/socket.c (socket_s_ip_address_list): drop inactiveusa
adapters. * test/socket/test_{nonblock,addrinfo,socket}.rb: skip some tests on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01* include/ruby/intern.h (rb_time_num_new): declared.akr
* time.c (nsec2timev): extracted from time_new_internal. (time_new_internal): change argument to VALUE. (rb_time_new): follow the argument change. (rb_time_nano_new): ditto. (rb_time_num_new): new function. * ext/socket/ancdata.c (ancillary_timestamp): use rb_time_num_new to represent struct bintime preciously. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-18don't use /tmp as example socket path.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19use IO::WaitWritable.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19* io.c (rb_mWaitReadable): defined.akr
(rb_mWaitWritable): defined. (io_getpartial): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rb_io_write_nonblock): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. * error.c (make_errno_exc): extracted from rb_sys_fail. (rb_mod_sys_fail): new function. * include/ruby/ruby.h (rb_mod_sys_fail): declared. (rb_mWaitReadable): declared. (rb_mWaitWritable): declared. * ext/socket/init.c (rsock_s_recvfrom_nonblock): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rsock_s_accept_nonblock): extend IO::WaitReadable on EWOULDBLOCK, EAGAIN, ECONNABORTED and EPROTO. * ext/socket/socket.c (sock_connect_nonblock): extend IO::WaitWritable on EINPROGRESS. * ext/socket/ancdata.c (bsock_sendmsg_internal): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. (bsock_recvmsg_internal): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): raise SSLError extended by IO::WaitReadable/IO::WaitWritable on SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE. * ext/openssl/ossl.c (ossl_make_error): extracted from ossl_raise. (ossl_exc_new): new function. * ext/openssl/ossl.h (ossl_exc_new): declared. * lib/net/protocol.rb (rbuf_fill): rescue IO::WaitReadable and IO::WaitWritable. [ruby-core:22539], [ruby-dev:38140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14assert connects doesn't raise.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02* ext/socket/ancdata.c (rsock_discard_cmsg_resource): definedakr
unconditionally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-28* ext/socket/ancdata.c (ancillary_unix_rights): check message type.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27* ext/socket/ancdata.c (bsock_recvmsg_internal): close FDs passed byakr
SCM_RIGHTS unless :scm_rights=>true is given. (discard_cmsg): extracted from rsock_discard_cmsg_resource. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26* ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25* ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.akr
(sockopt_optname): extracted from sockopt_optname_m. (sockopt_data): apply StringValue. (sockopt_s_linger): new method. (sockopt_linger): new method. (inspect_linger): show onoff value if it is neither 0 nor 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25* ext/socket/ancdata.c (ancillary_s_unix_rights): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* ext/socket/ancdata.c (ancillary_timestamp): support SCM_BINTIME.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* ext/socket/ancdata.c (ancillary_timestamp): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* ext/socket/ancdata.c (inspect_timespec_as_abstime): new function toakr
show struct timespec. (ancillary_inspect): use it for SCM_TIMESTAMPNS on GNU/Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* ext/socket/ancdata.c (inspect_bintime_as_abstime): new function toakr
show struct bintime. (ancillary_inspect): use it for SCM_BINTIME on FreeBSD. * ext/socket/mkconstants.rb: define SCM_BINTIME. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* ext/socket/ancdata.c (inspect_timeval_as_abstime): use time_takr
variable to avoid a warning on environments which use long as tv_sec as NetBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-21* io.c (io_getpartial): error message describes what should beakr
waited after nonblocking error. (rb_io_write_nonblock): ditto. * ext/socket/init.c (s_recvfrom_nonblock): ditto. (s_accept_nonblock): ditto. * ext/socket/socket.c (sock_connect_nonblock): ditto. * ext/socket/ancdata.c (bsock_sendmsg_internal): ditto. (bsock_recvmsg_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19* ext/socket/ancdata.c (ancillary_unix_rights): method renamed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18* ext/socket/ancdata.c (ancillary_rights): new method.akr
(make_io_for_rights): new function to allocate IOs for FDs in SCM_RIGHTS message. (bsock_recvmsg_internal): use make_io_for_rights. So the FDs can be closed by GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17care EWOULDBLOCK of accept_nonblock.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14add timeout.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* test/socket/test_socket.rb (test_udp_server): filter out unreachableakr
addresses. [ruby-dev:37970] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12test only if Socket::AncillaryData exists.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11test updated.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11* ext/socket/lib/socket.rb (Socket.unix_server_socket): close theakr
socket when the block exits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11* ext/socket/lib/socket.rb (Socket.unix_server_socket): call the blockakr
if given. remove the socket file when the block exits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11* ext/socket/ancdata.c (ancillary_s_ip_pktinfo): make 3rd argumentakr
optional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11add tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11rename tests classes.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11add tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11* ext/socket/extconf.rb: check getpeereid.akr
* ext/socket/basicsocket.c (bsock_getpeereid): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10* ext/socket/lib/socket.rb (Socket.udp_server_sockets): new method.akr
(Socket.udp_server_loop_on): new method. (Socket.udp_server_loop): new method (Socket.ip_sockets_port0): extracted from tcp_server_sockets_port0. (Socket::UDPSource): new class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10* ext/socket/option.c (sockopt_s_bool): new method.akr
(sockopt_bool): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09* ext/socket/ancdata.c (ancillary_initialize): add family argument.akr
(ancdata_new): ditto. (ancillary_s_int): ditto. (ancillary_family): new function. (ancillary_family_m): new method. (ancillary_s_ip_pktinfo): follow ancdata_new change. (ancillary_s_ipv6_pktinfo): ditto. (bsock_recvmsg_internal): examine the socket address family. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/option.c (inspect_peercred): struct ucred containsakr
effective uid/gid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08LOCAL_PEERCRED is also available on MacOS X.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/option.c (inspect_local_peercred): cr_uid is a effectiveakr
uid, not a real uid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.akr
* ext/socket/rubysocket.h: include sys/param.h and sys/ucred.h. * ext/socket/option.c (inspect_local_peercred): new function to show LOCAL_PEERCRED socket option on FreeBSD. (sockopt_inspect): show as LOCAL_* socket option if AF_UNIX and level is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08remove debug print.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/option.c (inspect_peercred): new function to showakr
SO_PEERCRED socket option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/extconf.rb: check struct cmsgcred.akr
* ext/socket/ancdata.c (anc_inspect_passcred_credentials): add "(ucred)". (anc_inspect_socket_creds): show struct cmsgcred too, for FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08test renamed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* ext/socket/extconf.rb: check struct sockcred.akr
* ext/socket/ancdata.c (anc_inspect_socket_creds): new function to show SCM_CREDS on NetBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e