Граф коммитов

126 Коммитов

Автор SHA1 Сообщение Дата
akr fb5d4ecfb5 * ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
unconditionally.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02 12:14:35 +00:00
akr 2ba6eec1fa * ext/socket/ancdata.c (ancillary_unix_rights): check message type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-28 09:29:26 +00:00
akr d8c66c4333 * ext/socket/ancdata.c (bsock_recvmsg_internal): close FDs passed by
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
2009-02-27 14:23:54 +00:00
akr 7f247b9d0c add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27 13:10:25 +00:00
akr ecb22ce2c5 * ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26 14:15:39 +00:00
akr e6f0b1de89 * ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.
(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
2009-02-25 15:26:25 +00:00
akr 56c52c1da8 * ext/socket/ancdata.c (ancillary_s_unix_rights): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25 14:19:24 +00:00
akr e137e939b7 * ext/socket/ancdata.c (ancillary_timestamp): support SCM_BINTIME.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 10:56:57 +00:00
akr b404c651d2 * ext/socket/ancdata.c (ancillary_timestamp): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 10:45:46 +00:00
akr 605cd65904 * ext/socket/ancdata.c (inspect_timespec_as_abstime): new function to
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
2009-02-23 11:41:38 +00:00
akr 23e286f3fb * ext/socket/ancdata.c (inspect_bintime_as_abstime): new function to
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
2009-02-23 11:32:43 +00:00
akr a0e3e8e4d1 * ext/socket/ancdata.c (inspect_timeval_as_abstime): use time_t
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
2009-02-23 11:21:45 +00:00
akr decee68028 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 18:14:01 +00:00
akr 9cfe35ad50 * io.c (io_getpartial): error message describes what should be
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
2009-02-21 15:57:52 +00:00
akr bed4294451 * ext/socket/ancdata.c (ancillary_unix_rights): method renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 12:13:38 +00:00
akr 18afbc891c * ext/socket/ancdata.c (ancillary_rights): new method.
(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
2009-02-18 18:43:15 +00:00
akr 536adb5d7c care EWOULDBLOCK of accept_nonblock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 11:05:35 +00:00
akr 9ddde2773f add timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 11:06:23 +00:00
akr a61786398a * test/socket/test_socket.rb (test_udp_server): filter out unreachable
addresses.  [ruby-dev:37970]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 14:24:11 +00:00
akr 97a922e2ff test only if Socket::AncillaryData exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 12:45:24 +00:00
akr 3032bdb1d3 test updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 15:29:35 +00:00
akr 3f0d724dc3 * ext/socket/lib/socket.rb (Socket.unix_server_socket): close the
socket when the block exits.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:54:52 +00:00
akr 0a954e9117 * ext/socket/lib/socket.rb (Socket.unix_server_socket): call the block
if given.  remove the socket file when the block exits.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:51:53 +00:00
akr ff955766d4 * ext/socket/ancdata.c (ancillary_s_ip_pktinfo): make 3rd argument
optional.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 07:44:53 +00:00
akr 6e6676a223 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:31:19 +00:00
akr a8de15e0b5 rename tests classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:17:57 +00:00
akr c9c3437b20 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:11:48 +00:00
akr b4e50055c3 * ext/socket/extconf.rb: check getpeereid.
* ext/socket/basicsocket.c (bsock_getpeereid): new method.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 01:22:08 +00:00
akr 1463f1dfe7 * ext/socket/lib/socket.rb (Socket.udp_server_sockets): new method.
(Socket.udp_server_loop_on): new method.
  (Socket.udp_server_loop): new method
  (Socket.ip_sockets_port0): extracted from tcp_server_sockets_port0.
  (Socket::UDPSource): new class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 12:38:16 +00:00
akr 98d3eca7fc * ext/socket/option.c (sockopt_s_bool): new method.
(sockopt_bool): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 12:09:57 +00:00
akr fd9c7e8af1 * ext/socket/ancdata.c (ancillary_initialize): add family argument.
(ancdata_new): ditto.
  (ancillary_s_int): ditto.
  (ancillary_family): new function.
  (ancillary_family_m): new method.
  (ancillary_s_ip_pktinfo): follow ancdata_new change.
  (ancillary_s_ipv6_pktinfo): ditto.
  (bsock_recvmsg_internal): examine the socket address family.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 10:49:16 +00:00
akr 64f12a46d5 * ext/socket/option.c (inspect_peercred): struct ucred contains
effective uid/gid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 17:04:40 +00:00
akr 2992642245 LOCAL_PEERCRED is also available on MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:49:35 +00:00
akr f11d2b55f7 * ext/socket/option.c (inspect_local_peercred): cr_uid is a effective
uid, not a real uid.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:42:17 +00:00
akr 9e45748143 * ext/socket/extconf.rb: check sys/param.h and sys/ucred.h.
* ext/socket/rubysocket.h: include sys/param.h and sys/ucred.h.

* ext/socket/option.c (inspect_local_peercred): new function to show
  LOCAL_PEERCRED socket option on FreeBSD.
  (sockopt_inspect): show as LOCAL_* socket option if AF_UNIX and level
  is 0.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:37:55 +00:00
akr e5f588c83d remove debug print.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:39:59 +00:00
akr 8f9d6d1863 * ext/socket/option.c (inspect_peercred): new function to show
SO_PEERCRED socket option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 14:23:16 +00:00
akr 411e9997d2 * ext/socket/extconf.rb: check struct cmsgcred.
* ext/socket/ancdata.c (anc_inspect_passcred_credentials): add
  "(ucred)".
  (anc_inspect_socket_creds): show struct cmsgcred too, for FreeBSD.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 12:53:55 +00:00
akr eb636217f6 test renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:37:39 +00:00
akr e960cf417a * ext/socket/extconf.rb: check struct sockcred.
* ext/socket/ancdata.c (anc_inspect_socket_creds): new function to
  show SCM_CREDS on NetBSD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:36:18 +00:00
akr 732b695163 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 11:30:26 +00:00
akr 03149710e8 * ext/socket/raddrinfo.c (init_unix_addrinfo): add socktype argument.
(addrinfo_initialize): follow init_unix_addrinfo change.
  (addrinfo_s_unix): add optional argument: socktype



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 04:53:17 +00:00
akr b83188dc1e add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 12:33:25 +00:00
akr 2b8ab6c54f * test/socket/test_addrinfo.rb (test_family_addrinfo): don't use
www.ruby-lang.org.
  http://d.hatena.ne.jp/nagachika/20090204/working_for_0f0e


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 12:28:15 +00:00
akr 88f04bdd32 * ext/socket: AddrInfo is renamed to Addrinfo. [ruby-dev:37876]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 11:01:43 +00:00
akr 0d0fe1a5ad don't connect to unspecified address (0.0.0.0). OpenBSD reject it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 00:09:39 +00:00
akr 1934c7a80b test relaxed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:42:13 +00:00
akr 3eab19122b add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:34:32 +00:00
akr e2f0aeb497 relax tests for MacOS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 15:12:53 +00:00
akr 9845b50c11 relax tests for IPv4 compat/mapped IPv6 addresss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 13:38:24 +00:00