Age | Commit message (Collapse) | Author |
|
sockets.
Patch by Eric Wong. [ruby-core:59429] [Feature #9330]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Patch by Eric Wong. [ruby-core:57950] [Bug #9039]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/socket.c (rsock_syserr_fail_host_port): add errno
argument version anduse rb_syserr_fail_str() instead of
rb_sys_fail_str() with restoring errno.
* ext/socket/socket.c (rsock_syserr_fail_path): ditto, and
rb_syserr_fail().
* ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto, use
rsock_syserr_fail_raddrinfo().
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto.
* ext/socket/socket.c (setup_domain_and_type): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/extconf.rb: check for if_nametoindex() for
i686-w64-mingw32, and check for declarations of if_indextoname() and
if_nametoindex().
* ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless
if_nametoindex() is available.
* ext/socket/rubysocket.h: declare if_indextoname() and
if_nametoindex() if available but not declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
MSVC has struct sockadddr_dl, but its content is broken.
http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130511T103938Z.log.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[ruby-core:54777] [Feature #8368]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
ext/socket/ancdata.c: Use HAVE_STRUCT_MSGHDR_MSG_CONTROL instead
of HAVE_ST_MSG_CONTROL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/raddrinfo.c (ext/socket/raddrinfo.c): Reject too long
Linux abstract socket name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
rsock_sys_fail_addrinfo.
(rsock_sys_fail_raddrinfo_or_sockaddr): Renamed from
rsock_sys_fail_addrinfo_or_sockaddr.
* ext/socket/rubysocket.h: Follow the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
and socklen_t instead of String object.
(rsock_sys_fail_addrinfo_or_sockaddr): Follow the above change.
* ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/extconf.rb (RSTRING_SOCKLEN): macro to cast RSTRING_LEN
to socklen_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40156 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
|
|
* ext/socket/rubysocket.h (rsock_sys_fail_sockaddr): Follow above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
(rsock_sys_fail_path): Ditto.
(rsock_sys_fail_sockaddr): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[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
|
|
and Darwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
sockaddr_storage for less casts.
* ext/socket/rubysocket.h (union_sockaddr): defined.
* ext/socket/socket.c (sock_accept): use union_sockaddr.
(sock_accept_nonblock): ditto.
(sock_sysaccept): ditto.
(sock_s_getnameinfo): ditto.
* ext/socket/basicsocket.c (bsock_getsockname): ditto.
(bsock_getpeername): ditto.
(bsock_local_address): ditto.
(bsock_remote_address): ditto.
* ext/socket/ancdata.c (bsock_recvmsg_internal): ditto.
* ext/socket/init.c (recvfrom_arg): ditto.
(recvfrom_blocking): ditto.
(rsock_s_recvfrom): ditto.
(rsock_s_recvfrom_nonblock): ditto.
(rsock_getfamily): ditto.
* ext/socket/raddrinfo.c (rb_addrinfo_t): ditto.
(ai_get_afamily): ditto.
(inspect_sockaddr): ditto.
(addrinfo_mdump): ditto.
(addrinfo_mload): ditto.
(addrinfo_getnameinfo): ditto.
(addrinfo_ip_port): ditto.
(extract_in_addr): ditto.
(addrinfo_ipv6_to_ipv4): ditto.
(addrinfo_unix_path): ditto.
* ext/socket/tcpserver.c (tcp_accept): ditto.
(tcp_accept_nonblock): ditto.
(tcp_sysaccept): ditto.
* ext/socket/ipsocket.c (ip_addr): ditto.
(ip_peeraddr): ditto.
(ip_s_getaddress): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/raddrinfo.c (rsock_make_hostent): ai_addrlen is not
size_t but socklen_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/rubysocket.h: use HAVE_TYPE_STRUCT_SOCKADDR_STORAGE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
socket address.
* ext/socket/rubysocket.h (rsock_make_ipaddr): add an argument for
socket address length.
(rsock_ipaddr): ditto.
* ext/socket/ipsocket.c (ip_addr): pass length to rsock_ipaddr.
(ip_peeraddr): ditto.
(ip_s_getaddress): pass length to rsock_make_ipaddr.
* ext/socket/socket.c (make_addrinfo): pass length to rsock_ipaddr.
(sock_s_getnameinfo): pass actual address length to rb_getnameinfo.
(sock_s_unpack_sockaddr_in): pass length to rsock_make_ipaddr.
* ext/socket/init.c (rsock_s_recvfrom): pass length to rsock_ipaddr.
(rsock_s_recvfrom_nonblock): ditto.
* ext/socket/tcpsocket.c (tcp_sockaddr): pass length to
rsock_make_ipaddr.
* ext/socket/raddrinfo.c (make_ipaddr0): add an argument for socket
address length. pass the length to rb_getnameinfo.
(rsock_ipaddr): ditto.
(rsock_make_ipaddr): add an argument for socket address length.
pass the length to make_ipaddr0.
(make_inetaddr): pass length to make_ipaddr0.
a local variable renamed.
(host_str): a local variable renamed.
(port_str): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
use HAVE_STRUCT_SOCKADDR_SA_LEN and HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/rubysocket.h: define socklen_t if not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
rsock_unixpath_len, because it returns not the length of the path,
but the length of a socket address for the path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38943 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
|
|
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
|
|
* include/ruby/thread.h: new header file for thread stuff.
* thread.c (rb_thread_call_without_gvl): export. [Feature#4328]
returns void* instead of VALUE. [Feature #5543]
* thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/rubysocket.h: ditto.
* ext/tk/stubs.c: ditto.
* io.c: ditto.
* process.c: ditto.
* signal.c: ditto.
* vm_dump.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
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
|
|
r33876. [ruby-core:41475] [Bug #5706]
* ext/socket/extconf.rb: the alternative hack for [Bug #5675].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
win32.h.
* ext/socket/rubysocket.h: include ruby/subst.h. [Bug #5675]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/ancdata.c (rsock_recvmsg): extracted from
nogvl_recvmsg_func.
(nogvl_recvmsg_func): use rsock_recvmsg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/rubysocket.h (rsock_discard_cmsg_resource): add
msg_peek_p argument for the declaration.
* ext/socket/ancdata.c (discard_cmsg): add msg_peek_p argument.
assume FreeBSD, NetBSD and MacOS X doesn't generate passed fd
when MSG_PEEK.
(rsock_discard_cmsg_resource): add msg_peek_p argument.
(bsock_recvmsg_internal): call rsock_discard_cmsg_resource with
msg_peek_p argument.
* ext/socket/unixsocket.c (unix_recv_io): call
rsock_discard_cmsg_resource with msg_peek_p argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
from intern.h to internal.h. It's still experimental API and
need more discussion. [ruby-dev:43698]
* include/ruby/intern.h: ditto.
* ext/socket/rubysocket.h: include internal.h.
* ext/socket/depend: add internal.h dependency.
* ext/socket/extconf.rb: add $INCFLAGS to topdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
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
|
|
bug in system header of darwin 9. [ruby-core:32341]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
to be shared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
getaddrinfo.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* ext/socket/addrinfo.c: rename {addr,name}info functions to ensure
those are used on darwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
(rsock_addrinfo): renamed from sock_addrinfo.
(rsock_getaddrinfo): renamed from sock_getaddrinfo.
(rsock_socket): renamed from ruby_socket.
(rsock_sock_s_socketpair): renamed from sock_s_socketpair.
(rsock_connect): renamed from ruby_connect.
* ext/socket/socket.c (sock_listen): make it static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
sent on LP64 platform.
* ext/socket/rubysocket.h (rsock_discard_cmsg_resource): declared.
* ext/socket/ancdata.c (rsock_discard_cmsg_resource): renamed from
discard_cmsg_resource. export it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
using getpeerucred.
* ext/socket/extconf.rb: check ucred.h and getpeerucred.
* ext/socket/rubysocket.h: include ucred.h if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|