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

28 Коммитов

Автор SHA1 Сообщение Дата
akr 80d230c394 * ext/socket/option.c (inspect_linger): message refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 11:09:55 +00:00
akr c160c6e59e * ext/socket/option.c (inspect_errno): new function.
(sockopt_inspect): use inspect_errno for SO_ERROR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 09:40:42 +00:00
nobu da97071549 * ext/socket/option.c: suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 18:14:20 +00:00
akr 9bd0ecd917 add comments for rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 16:29:43 +00:00
akr f871e8cf0d update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11 04:29:12 +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 939efe7d4c * ext/socket/option.c (sockopt_family_m): renamed from sockopt_family.
(sockopt_level_m): renamed from sockopt_level.
  (sockopt_optname_m): renamed from sockopt_optname.
  (inspect_local_peercred): follow the renaming.
  (Init_sockopt): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 11:59:04 +00:00
nobu 160c230f94 * ext/socket/option.c (inspect_local_peercred): constfied.
* ext/socket/ancdata.c (anc_inspect_socket_creds): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 03:57:23 +00:00
akr 2acc18ad99 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 00:18:53 +00:00
akr b877fc2f15 * ext/socket/option.c (sockopt_inspect): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 16:23:36 +00:00
akr 97ba0d4aa7 * ext/socket/mkconstants.rb: generate intern_family_noprefix.
* ext/socket/option.c (sockopt_inspect): use intern_family_noprefix
  not to show AF_ prefix.

* ext/socket/ancdata.c (ancillary_inspect): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 16:03:08 +00:00
akr 2dd3fa9f3e * ext/socket/mkconstants.rb: rename level_to_int to iplevel_to_int.
rename intern_level to intern_iplevel.

* ext/socket/constants.c: follow the renaming.

* ext/socket/option.c: ditto.

* ext/socket/ancdata.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 14:05:37 +00:00
akr f5da7031b9 * ext/socket/rubysocket.h (level_arg): add family argument.
(optname_arg): ditto.
  (cmsg_type_arg): ditto.
  (rb_sock_getfamily): declared.

* ext/socket/constants.c (level_arg): add family argument.
  (optname_arg): ditto.
  (cmsg_type_arg): ditto.

* ext/socket/init.c (rb_sock_getfamily): defined.

* ext/socket/option.c (sockopt_initialize): give family for level_arg
  and optname_arg.
  (sockopt_s_int): ditto.

* ext/socket/basicsocket.c (bsock_setsockopt): ditto.
  (bsock_getsockopt): ditto.

* ext/socket/ancdata.c (ancillary_initialize): ditto.
  (ancillary_s_int): ditto.
  (ancillary_cmsg_is_p): ditto.
  (bsock_sendmsg_internal): ditto.
  (bsock_recvmsg_internal): use rb_sock_getfamily.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 13:56:43 +00:00
akr 2092fbcc3a rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 12:52:11 +00:00
akr 7ad3567934 * ext/socket/option.c (inspect_int): return 1/0 on success/failure.
(inspect_uint): ditto.
  (inspect_linger): ditto.
  (inspect_socktype): ditto.
  (inspect_timeval): ditto.
  (inspect_peercred): ditto.
  (inspect_local_peercred): ditto.
  (sockopt_inspect): refactored.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 11:04:51 +00:00
akr 48de4753d1 * ext/socket/option.c (sockopt_initialize): argument conversion
reordered.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 10:52:55 +00:00
akr 70f7660196 * ext/socket/option.c (inspect_local_peercred): check version.
(sockopt_inspect): suppress warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-09 00:06:41 +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 d0454a211e * ext/socket/option.c (sockopt_inspect): add ifdef guard for
LOCAL_PEERCRED.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:45:15 +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 c02ce88762 * ext/socket/rubysocket.h (sockopt_new): add family argument.
* ext/socket/option.c (sockopt_initialize): add vfamily argument.
  (sockopt_new): add family argument and record it in the object.
  (sockopt_family): new method.
  (sockopt_s_int): add vfamily argument.
  (sockopt_inspect): show family.

* ext/socket/basicsocket.c (bsock_getsockopt): check address family
  using getsockname.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08 15:12:27 +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 9946e700c1 * ext/socket/raddrinfo.c (Init_addrinfo): add AddrInfo#to_s as an
alias of AddrInfo#to_sockaddr.

* ext/socket/option.c (Init_sockopt): add Socket::Option#to_s as an
  alias of Socket::Option#data.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 14:44:28 +00:00
akr b41a9abb6a * ext/socket/option.c: use INET6 instead of IPV6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:18:55 +00:00
usa bf23d53b94 * ext/socket/{options,raddrinfo}.c: use INET6 instead of AF_INET6 for
VC++6.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 03:48:31 +00:00
akr ef9206bbea * ext/socket/rubysocket.h (rb_cSockOpt): declared.
(sockopt_new): ditto.
  (Init_sockopt): ditto.

* ext/socket/init.c (Init_socket_init): call Init_sockopt.

* ext/socket/depend: add dependency for option.o

* ext/socket/mkconstants.rb: generate intern_level, intern_so_optname,
  intern_ip_optname, intern_ipv6_optname, intern_tcp_optname,
  intern_udp_optname and intern_scm_optname.

* ext/socket/extconf.rb: add option.o.

* ext/socket/basicsocket.c (bsock_setsockopt): accept Socket::Option
  object.
  (bsock_getsockopt): return Socket::Option object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 01:53:02 +00:00