summaryrefslogtreecommitdiff
path: root/test/socket
AgeCommit message (Collapse)Author
2014-10-04test/socket/test_unix.rb (TestSocket_UNIXSocket#test_too_long_path): ↵odaira
sockaddr_un.sun_path in AIX is defined as char[1024], so "a" * 300 is not too long. "a" * 3000 would be enough. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28Suppress warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* ext/socket/unixsocket.c (rsock_init_unixsock): Open a socketakr
after path length check. This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28test_socket.rb: ignore interface without addressnobu
* test/socket/test_socket.rb (test_udp_server): ignore interface with no address assigned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27use Socket.getifaddrs to show interface names and so onnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-24test_udp_server don't test IPv6 link-local addresses.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18Use Etc.uname instead of uname command invocation.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21socket: sendmsg/recvmsg only retries blocking on errorsnormal
* ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error (bsock_recvmsg_internal): ditto * test/socket/test_unix.rb: test above for infinite loop git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-18* test/socket/test_socket.rb: unix socket is required by test case.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-18* test/socket/test_addrinfo.rb: remove unused variables.hsbt
* test/socket/test_nonblock.rb: ditto. * test/socket/test_socket.rb: ditto. * test/socket/test_unix.rb: ditto. * test/testunit/test_parallel.rb: ditto. * test/webrick/test_filehandler.rb: ditto. * test/xmlrpc/test_features.rb: ditto. * test/zlib/test_zlib.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP andakr
IP_MULTICAST_TTL on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr
it may be set before the body. Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247] * lib/cgi/core.rb: Ditto. * lib/drb/ssl.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26* io.c (io_read_nonblock): support non-blocking reads without raisingtenderlove
exceptions. As in: `io.read_nonblock(size, exception: false)` [ruby-core:38666] [Feature #5138] * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto * ext/stringio/stringio.c (strio_sysread): ditto * io.c (rb_io_write_nonblock): support non-blocking writes without raising an exception. * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto * test/openssl/test_pair.rb (class OpenSSL): tests * test/ruby/test_io.rb (class TestIO): ditto * test/socket/test_nonblock.rb (class TestSocketNonblock): ditto * test/stringio/test_stringio.rb (class TestStringIO): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-19* test/socket/test_tcp.rb (test_initialize_failure): Use EADDRNOTAVAILakr
to test an error message generated by bind() failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05Use server_port for Windowsnaruse
fix r41686 [Bug #8574] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-28* ext/socket/ipsocket.c (init_inetsock_internal): Don't use localakr
addresses which address family is different to remote address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26* test/socket/test_udp.rb: Close sockets explicitly.akr
Don't use fixed port number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02* test/socket/test_sockopt.rb: change test name. follow r41037.ayumin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02follow r41034naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31* ext/socket/option.c (sockopt_s_byte): constructor of the sockoptnaruse
whose value's is byte. * ext/socket/option.c (sockopt_byte): getter for above. * ext/socket/option.c (inspect_byte): inspect for above. * ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of the sockopt whose optname is IP_MULTICAST_LOOP. * ext/socket/option.c (sockopt_ip_multicast_loop): getter for above. * ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of the sockopt whose optname is IP_MULTICAST_TTL. * ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above. * ext/socket/option.c (sockopt_inspect): use above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11* ext/socket: New method, Socket.getifaddrs, implemented.akr
[ruby-core:54777] [Feature #8368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09* ext/socket/ancdata.c (bsock_sendmsg_internal): Always setakr
controls_num to raise NotImplementedError appropriately. (bsock_recvmsg_internal): Raise NotImplementedError if :scm_rights=>true is given on platforms which don't have 4.4BSD style control message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08Fix #6154 by introducing new EAGAIN/EWOULDBLOCK/EINPROGRESSheadius
subclasses that include WaitReadable or WaitWritable rather than extending them into the exception object each time. * error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and export them for use in WaitReadable/Writable exceptions. * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail for nonblocking failures using those exceptions. Use that function in io_getpartial and io_write_nonblock instead of rb_mod_sys_fail * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include WaitReadable and WaitWritable. Use those classes for write_would_block and read_would_block instead of rb_mod_sys_fail. * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in bsock_sendmsg_internal and bsock_recvmsg_internal. * ext/socket/init.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in rsock_s_recvfrom_nonblock and rsock_s_connect_nonblock. * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in sock_connect_nonblock. * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06* ext/socket/rubysocket.h (SockAddrStringValueWithAddrinfo): New macro.akr
(rsock_sockaddr_string_value_with_addrinfo): New declaration. (rsock_addrinfo_inspect_sockaddr): Ditto. (rsock_sys_fail_addrinfo): Ditto. (rsock_sys_fail_sockaddr_or_addrinfo): Ditto. * ext/socket/raddrinfo.c (rsock_addrinfo_inspect_sockaddr): Renamed from addrinfo_inspect_sockaddr and exported. (rsock_sockaddr_string_value_with_addrinfo): New function to obtain string and possibly addrinfo object. * ext/socket/socket.c (rsock_sys_fail_sockaddr): Don't use rsock_sys_fail_host_port which is IP dependent. Invoke rsock_sys_fail_addrinfo. (rsock_sys_fail_addrinfo): New function using rsock_addrinfo_inspect_sockaddr. (rsock_sys_fail_addrinfo_or_sockaddr): New function. (sock_connect): Use SockAddrStringValueWithAddrinfo and rsock_sys_fail_addrinfo_or_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06* ext/socket: Improve socket exception message to show socket address.akr
[ruby-core:45617] [Feature #6583] proposed Eric Hodel. * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Declared. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. * ext/socket/udpsocket.c (udp_connect): Use rsock_sys_fail_host_port. (udp_bind): Ditto. (udp_send): Ditto. * ext/socket/init.c (rsock_init_sock): Specify a string for rb_sys_fail argument. (make_fd_nonblock): Ditto. (rsock_s_accept): Ditto. * ext/socket/ipsocket.c (init_inetsock_internal): Use rsock_sys_fail_host_port. * ext/socket/socket.c (rsock_sys_fail_host_port): Defined. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. (setup_domain_and_type): Use rsock_sys_fail_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. (sock_gethostname): Specify a string for rb_sys_fail argument. (socket_s_ip_address_list): Ditto. * ext/socket/basicsocket.c (bsock_shutdown): Specify a string for rb_sys_fail argument. (bsock_setsockopt): Use rsock_sys_fail_path. (bsock_getsockopt): Ditto. (bsock_getpeereid): Refine the argument for rb_sys_fail. * ext/socket/unixsocket.c (rsock_init_unixsock): Use rsock_sys_fail_path. (unix_path): Ditto. (unix_send_io): Ditto. (unix_recv_io): Ditto. (unix_addr): Ditto. (unix_peeraddr): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-31* ext/socket/raddrinfo.c (rsock_unix_sockaddr_len): returnshugo
sizeof(sa_familiy_t) if path is empty. see "Autobind Feature" in unix(7) for details. * ext/socket/lib/socket.rb (unix_socket_abstract_name?): treat an empty path as an abstract name. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-30* ext/socket/unixsocket.c (rsock_init_unixsock): use rb_inspect()shugo
because rb_sys_fail_str() fails if its argument contains NUL. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* ext/socket/socket.c (sock_s_pack_sockaddr_un): calculate theshugo
correct address length of an abstract socket. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-25* ext/socket/raddrinfo.c (rsock_unixpath_len, init_unix_addrinfo),shugo
ext/socket/unixsocket.c (unixsock_connect_internal, rsock_init_unixsock): calculate the correct address length of an abstract socket. Without this fix, sizeof(struct sockaddr_un) is specified as the length of an abstract socket for bind(2) or connect(2), so the address of the socket is filled with extra NUL characters. See unix(7) for details. * ext/socket/lib/socket.rb (unix_server_socket): don't access the file system if the platform is Linux and path starts with NUL, which means that the socket is an abstract socket. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-30Check if there is no error before reconnect [Bug #4387]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-26Revert "Darwin 12 (OS X Mountain Lion) also has Bug #6692"naruse
This reverts commit r37033. darwin12 seems to use an address started with fe80. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-26Darwin 12 (OS X Mountain Lion) also has Bug #6692naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24Show nd6 options and whether the packet is reached to the server or not.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24Add version check for darwin's bug.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20* test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OSdrbrain
X (iCloud Back to my Mac addresses) for test_udp_socket since they do not act as loopback addresses. [Bug #6692] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20* ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Addeddrbrain
Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local addresses. Part of #6692 * ext/socket/rubysocket.h: Add IN6_IS_ADDR_UNIQUE_LOCAL macro if missing. * test/socket/test_addrinfo.rb: Test for ipv6_unqiue_local? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-14Check IFDISABLED on Mac OS X.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10fix the path of ifconfig.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10skip addresses whose interface is set as POINTOPOINT.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10Skip IPv6 addresses whose interface is set as IFDISABLED.naruse
FreeBSD 9.0 with default setting (ipv6_activate_all_interfaces is not YES) sets IFDISABLED to interfaces which don't have global IPv6 address. Link-local IPv6 addresses on those interfaces don't work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-26* ext/socket/raddrinfo.c (init_unix_addrinfo): support the longestakr
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
2012-04-23* test/socket/test_unix.rb (bound_unix_socket): make temporaryakr
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
2012-01-09* ext/socket/lib/socket.rb (family_addrinfo): return the givenakr
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
2012-01-07Cent OS 5.6 (2.6.18-238.19.1.el5xen) doesn't correctly worknaruse
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
2011-11-03add test for close-on-exec.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03close a socket in test_socket_new.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13* test/socket/test_socket.rb (test_connect_timeout): added a testakr
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
2011-06-13* test/socket/test_unix.rb: don't use Thread.abort_on_exception.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e