aboutsummaryrefslogtreecommitdiffstats
path: root/test/socket
Commit message (Collapse)AuthorAgeFilesLines
* * ext/socket/raddrinfo.c (init_unix_addrinfo): support the longestakr2012-04-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | path in sockaddr_un. (inspect_sockaddr): ditto. (addrinfo_mdump): ditto. (addrinfo_mload): ditto. (rsock_unixpath_str): new function. (rsock_unixpath): removed. (rsock_unixaddr): use rsock_unixpath_str. * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest path in sockaddr_un. (sock_s_unpack_sockaddr_un): ditto. (sock_s_gethostbyaddr): unused variable removed. * ext/socket/unixsocket.c (rsock_init_unixsock): support the longest path in sockaddr_un. * ext/socket/rubysocket.h (rsock_unixpath_str): declared. (rsock_unixpath): removed. * test/socket/test_unix.rb: comment out test_nul because abstract unix sockets may contain NULs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_unix.rb (bound_unix_socket): make temporaryakr2012-04-231-1/+1
| | | | | | | | | filename shorter for less possibility of Unix socket path over 107 bytes when TMPDIR has long path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/lib/socket.rb (family_addrinfo): return the givenakr2012-01-091-0/+18
| | | | | | | | | addrinfo object. Patch by Ippei Obayashi. [ruby-dev:45095] [Bug #5845] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Cent OS 5.6 (2.6.18-238.19.1.el5xen) doesn't correctly worknaruse2012-01-071-0/+6
| | | | | | sendmsg with pktinfo for link-local ipv6 addresses git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for close-on-exec.akr2011-11-032-0/+51
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* close a socket in test_socket_new.akr2011-11-031-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_socket.rb (test_connect_timeout): added a testakr2011-08-131-0/+28
| | | | | | | based on a patch by Eric Wong. [ruby-core:38910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_unix.rb: don't use Thread.abort_on_exception.akr2011-06-131-4/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/unixsocket.c (unix_send_io): race condition fixed.akr2011-06-131-0/+37
| | | | | | | | | | (unix_recv_io): ditto. fixed by Eric Wong. [ruby-core:35574] * test/socket/test_unix.rb: test added for above problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/test/unit.rb (assert_include): add alias.nobu2011-02-121-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_io_blocking_region): new function to runnobu2011-02-121-0/+20
| | | | | | | blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_addrinfo.rb: extract Errno::EADDRINUSE as a method.akr2010-12-012-6/+14
| | | | | | | | * test/socket/test_socket.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refine an assertion message.akr2010-06-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): new workaround forakr2010-06-231-0/+9
| | | | | | | | getaddrinfo problem on Mac OS X Snow Leopard. [ruby-core:29427] patch by Wataru Kimura. [ruby-core:30842] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_socket.rb (test_udp_server): rescue Errno::ENOSYSakr2010-06-142-2/+2
| | | | | | | | | | | | for Windows. * test/socket/test_nonblock.rb (test_sendmsg_nonblock_error): ditto. [ruby-dev:41597] reported by Masaya Tarui. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_addrinfo.rb: ipaddr.rb defines Socket::AF_INET6 as an Objectusa2010-05-191-1/+1
| | | | | | | if the constant is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_unix.rb (TestSocket_UNIXSocket#test_recvmsg):nobu2010-04-281-0/+1
| | | | | | skip if AncillaryData is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* call unix_server.close only if unix_server is not nil.akr2010-02-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: suppress warnings.akr2010-01-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use UDP for sendmsg/recvmsg tests.akr2009-07-191-5/+31
| | | | | | | 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
* * test_socket.rb (test_udp_server): cannot check the existance of sendmsg byusa2009-07-191-6/+13
| | | | | | | respond_to?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix skip condition.akr2009-07-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (socket_s_ip_address_list): drop inactiveusa2009-07-173-4/+13
| | | | | | | | | | | 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
* * include/ruby/intern.h (rb_time_num_new): declared.akr2009-07-011-0/+1
| | | | | | | | | | | | | | * 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
* don't use /tmp as example socket path.akr2009-06-182-16/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use IO::WaitWritable.akr2009-03-192-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_mWaitReadable): defined.akr2009-03-192-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* assert connects doesn't raise.akr2009-03-141-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-062-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (rsock_discard_cmsg_resource): definedakr2009-03-022-0/+2
| | | | | | | unconditionally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (ancillary_unix_rights): check message type.akr2009-02-281-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (bsock_recvmsg_internal): close FDs passed byakr2009-02-271-3/+3
| | | | | | | | | 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
* add a test.akr2009-02-271-0/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.akr2009-02-261-15/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.akr2009-02-251-0/+17
| | | | | | | | | | | (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
* * ext/socket/ancdata.c (ancillary_s_unix_rights): new method.akr2009-02-251-1/+58
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (ancillary_timestamp): support SCM_BINTIME.akr2009-02-241-2/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (ancillary_timestamp): new method.akr2009-02-241-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (inspect_timespec_as_abstime): new function toakr2009-02-231-0/+23
| | | | | | | | | 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
* * ext/socket/ancdata.c (inspect_bintime_as_abstime): new function toakr2009-02-231-0/+18
| | | | | | | | | | | 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
* * ext/socket/ancdata.c (inspect_timeval_as_abstime): use time_takr2009-02-231-2/+2
| | | | | | | | 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
* add a test.akr2009-02-221-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_getpartial): error message describes what should beakr2009-02-211-2/+72
| | | | | | | | | | | | | | | | | 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
* * ext/socket/ancdata.c (ancillary_unix_rights): method renamed.akr2009-02-191-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (ancillary_rights): new method.akr2009-02-181-8/+9
| | | | | | | | | | (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
* care EWOULDBLOCK of accept_nonblock.akr2009-02-171-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add timeout.akr2009-02-141-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_socket.rb (test_udp_server): filter out unreachableakr2009-02-121-0/+3
| | | | | | | addresses. [ruby-dev:37970] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test only if Socket::AncillaryData exists.akr2009-02-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test updated.akr2009-02-111-23/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e