summaryrefslogtreecommitdiff
path: root/ext/socket
AgeCommit message (Collapse)Author
2013-02-06fixed commit miss of previous commit.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-06merge revision(s) 35474,35479,38939,38943,38963,38991,38994: [Backport #7786]usa
* ext/socket/raddrinfo.c (init_unix_addrinfo): support the longest 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. * ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest path in sockaddr_un, really. reported by nagachika. http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476 * ext/socket/raddrinfo.c (rsock_unixpath_len, init_unix_addrinfo), 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. * ext/socket/raddrinfo (rsock_unix_sockaddr_len): renamed from rsock_unixpath_len, because it returns not the length of the path, but the length of a socket address for the path. * ext/socket/socket.c (sock_s_pack_sockaddr_un): calculate the correct address length of an abstract socket. * test/socket/test_unix.rb: related test. * ext/socket/unixsocket.c (rsock_init_unixsock): use rb_inspect() because rb_sys_fail_str() fails if its argument contains NUL. * test/socket/test_unix.rb: related test. * ext/socket/raddrinfo.c (rsock_unix_sockaddr_len): return 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/branches/ruby_1_9_3@39096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-06merge revision(s) 38993: [Backport #7775]usa
* ext/socket/basicsocket.c (bsock_getsockname): ignore truncated part of socket address. (bsock_getpeername): ditto. (bsock_local_address): ditto. (bsock_remote_address): ditto. * ext/socket/unixsocket.c (unix_path): ditto. (unix_addr): ditto. (unix_peeraddr): ditto. * ext/socket/init.c (cloexec_accept): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15* backport r32977 from trunkdrbrain
* ext/socket: Make Socket documentation appear. Add documentation for Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert. [Ruby 1.9 - Feature #5182] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29* ext/socket/lib/socket.rb (udp_server_sockets): unused variableakr
removed. patch by Jeremy Evans. [ruby-core:38600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29* ext/socket/mkconstants.rb: fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29* ext/socket/mkconstants.rb: use whitespaces as a separator.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29* ext/socket/mkconstants.rb: add documents for constants.akr
patch by Eric Hodel. [ruby-core:37853] [Bug #4989] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-24* ext/socket/extconf.rb: refine the recvmsg test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-24* ext/socket/extconf.rb: fix the recvmsg test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23* ext/socket/extconf.rb: test recvmsg allocates file descriptors forakr
fd passing even with MSG_PEEK. * ext/socket/ancdata.c: use the above test result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23* io.c (rb_update_max_fd): validate fd.akr
* 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/branches/ruby_1_9_3@32638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21* ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20* backport r32579, r32581, r32587 by akr and r32588 by kazu.akr
r32579: * io.c (rb_update_max_fd): new function. * internal.h (rb_update_max_fd): declare rb_update_max_fd. * thread_pthread.c (rb_thread_create_timer_thread): update max fd when timer thread pipe is created. r32581: * io.c (UPDATE_MAXFD): removed. r32587: * include/ruby/intern.h (rb_update_max_fd): declaration moved from internal.h. * file.c: ditto. * io.c: call rb_update_max_fd for each new fds. * process.c: ditto. * random.c: ditto. * ruby.c: ditto. * ext/io/console/console.c: ditto. * ext/openssl/ossl_bio.c: ditto. * ext/pty/pty.c: ditto. * ext/socket/init.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. r32588: * io.c (rb_update_max_fd): remove parentheses. they are not in macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-22* ext/socket/depend (SOCK_HEADERS): use $(top_srcdir) instaed ofkosaki
$(topdir). sorry! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21* internal.h: move rb_thread_io_blocking_region() declarationkosaki
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
2011-06-17update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* ext/socket/unixsocket.c (unix_send_io): race condition fixed.akr
(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
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.drbrain
[Ruby 1.9 - Bug #4664] * lib/rexml: ditto * lib/mkmf.rb: ditto * ext/socket/lib/socket.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 * Various .document files: Update .document files to match files whichdrbrain
have documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* ext/socket/init.c (wait_connectable): fix error handling code.kosaki
RB_WAITFD_OUT is turned on even though an error occur. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* ext/socket/init.c (wait_connectable): use rb_wait_for_single_fd().kosaki
The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] * ext/socket/init.c (try_wait_connectable, wait_connectable_ensure): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-01* ext/socket/init.c (rsock_connect): add to care EINTR. basedkosaki
on a patch from Eric Wong at [ruby-core:35621][Bug #4555] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* include/ruby/intern.h (rb_thread_select): mark as deprecated.kosaki
* ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select instead of rb_thread_select. * ext/socket/init.c (wait_connectable0): ditto. * ext/readline/readline.c (readline_event): ditto. * io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable, wait_writable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-28* ext/socket/raddrinfo.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-27* ext/socket/ipsocket.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-26* ext/socket/getaddrinfo.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-16* ext/socket/ipsocket.c (init_inetsock_internal): raise an error onakr
listen(2) failure. reported by Xavier Shay. [ruby-core:35505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
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
2010-12-26* ext/socket/mkconstants.rb: add IF_NAMESIZE.akr
add a default for INET6_ADDRSTRLEN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26* ext/socket/mkconstants.rb: define INET_ADDRSTRLEN as 16 if notakr
available. fix compilation error on mswin32-60. reported by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26fix a typo.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26* ext/socket/option.c: define IFNAMSIZ if not available.akr
fix compilation error on mingw32. reported by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26update comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26* ext/socket/option.c (rb_if_indextoname): new function to abstractakr
environments without if_indextoname. (inspect_ipv6_multicast_if): new function to inspect IPV6_MULTICAST_IF. Socket::Option.new(:INET6, :IPV6, :MULTICAST_IF, [2].pack("I!")).inspect is "#<Socket::Option: INET6 IPV6 MULTICAST_IF eth0>". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25This ifdef should be useless after r30374.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * ext/socket/extconf.rb: Fix build error which was introduced r30372.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* ext/socket/extconf.rb: check the existence of if_indextoname().usa
* ext/socket/option.c: yesterday's akr's commits destroyed the build of some unrelated platforms (such as Windows). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* ext/socket/option.c (inspect_ipv4_add_drop_membership): new functionakr
to inspect struct ip_mreq and struct ip_mreqn for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. Socket::Option.new(:INET, :IP, :ADD_MEMBERSHIP, [239,255,99,81, 0,0,0,0].pack("CCCCCCCC")).inspect is now "#<Socket::Option: INET IP ADD_MEMBERSHIP 239.255.99.81 0.0.0.0>". (inspect_ipv4_multicast_if): new function to inspect struct in_addr and struct ip_mreqn for IP_MULTICAST_IF. Socket::Option.new(:INET, :IP, :MULTICAST_IF, [192,168,0,7].pack("CCCC")).inspect is now "#<Socket::Option: INET IP MULTICAST_IF 192.168.0.7>". * ext/socket/extconf.rb: check struct ip_mreq and struct ip_mreqn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* ext/socket/option.c (inspect_ipv6_mreq): new function to inspectakr
struct ipv6_mreq for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. Socket::Option.new(:INET6, :IPV6, :JOIN_GROUP, [0xff12,0,0,0,0,0,0,1, 2].pack("nnnnnnnnI!")).inspect is now: "#<Socket::Option: INET6 IPV6 JOIN_GROUP ff12::1 eth0>" * ext/socket/extconf.rb: check struct ipv6_mreq. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11* fix type warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-01* ext/socket/extconf.rb: win64 is just same with win32 about socket.usa
notice: but wince is not same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* ext/socket/init.c (rsock_init_sock): conditionally used variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-23* ext/socket/raddrinfo.c (init_addrinfo, inspect_sockaddr): suppresswanabe
warnings. see [ruby-core:31932]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-14* ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): suppress anobu
warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-13suppress a warning.kanemoto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-13* ext/socket/rubysocket.h (__DARWIN_ALIGNBYTES): workaround of anobu
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