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
* 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
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
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
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
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
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
(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
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
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
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
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
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
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
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
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
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