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

406 Коммитов

Автор SHA1 Сообщение Дата
akr 28028fc2b9 * ext/socket/mkconstants.rb: generate a header file for generated
functions.

* ext/socket/rubysocket.h: include constdefs.h.  don't declare
  generated functions.

* ext/socket/constants.c: include constdefs.c instead of constants.h.

* ext/socket/depend: dependency updated.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 10:19:03 +00:00
akr 9cd0874fc2 * ext/socket/raddrinfo.c (make_inspectname): add a res argument to
suppress numeric inspectname.
  (init_addrinfo_getaddrinfo): call make_inspectname here.
  (addrinfo_firstonly_new): follow make_inspectname change.
  (addrinfo_list_new): ditto.
  (addrinfo_initialize): follow init_addrinfo_getaddrinfo change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 06:03:42 +00:00
akr 32bbcc6d52 * ext/socket/mkconstants.rb: don't cause an error for duplicate names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 05:53:05 +00:00
akr 3f9d4f1fbd rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 05:52:16 +00:00
akr 97cbab78dc * ext/socket: split files for each class.
* ext/socket/rubysocket.h: common header.

* ext/socket/basicsocket.c: new file for BasicSocket.

* ext/socket/ipsocket.c: new file for IPSocket.

* ext/socket/tcpsocket.c: new file for TCPSocket.

* ext/socket/tcpserver.c: new file for TCPServer.

* ext/socket/sockssocket.c: new file for SOCKSSocket.

* ext/socket/udpsocket.c: new file for UDPSocket.

* ext/socket/unixsocket.c: new file for UNIXSocket.

* ext/socket/unixserver.c: new file for UNIXServer.

* ext/socket/socket.c: now for Socket.

* ext/socket/raddrinfo.c: new file for AddrInfo and name resolution.

* ext/socket/constants.c: new file for constants.

* ext/socket/init.c: new file for utilities.

* ext/socket/mkconstants.rb: export *_to_int.

* ext/socket/extconf.rb: add new object files.

* ext/socket/depend: add dependencies for new files.

* ext/.document: add new files.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 04:11:27 +00:00
akr 6184d1d52a * ext/socket/socket.c: move addrinfo code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-16 13:31:49 +00:00
akr aaddab6dea * ext/socket/socket.c (addrinfo_s_ip): new method AddrInfo.ip.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 17:06:37 +00:00
nobu f188bf2acb * ext/socket/extconf.rb (gai_strerror): checks if available and if
returns const pointer.

* ext/socket/getaddrinfo.c (gai_strerror): defines only if non
  available.  [ruby-core:21328]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-14 04:09:05 +00:00
akr badd44845e * ext/socket/addrinfo.h (AI_NUMERICSERV): defined.
(AI_MASK): add AI_NUMERICSERV.

* ext/socket/getaddrinfo.c (getaddrinfo): support AI_NUMERICSERV.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 13:57:53 +00:00
akr 84775721bc * ext/socket/socket.c (rb_getaddrinfo): use getaddrinfo with GVL if
getaddrinfo.c/getnameinfo.c is used.  They are not thread safe
  because gethostbyname/gethostbyaddr is used.
  (rb_getnameinfo): ditto.

* extconf.rb: define GETADDRINFO_EMU if getaddrinfo.c/getnameinfo.c is
  used.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 12:41:12 +00:00
usa fc8835a5bb * ext/socket/{getaddrinfo,getnameinfo}.c: need to include ws2tcpip.h
on Windows.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 03:11:17 +00:00
duerst 654e94e1c9 Commit miss in previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 00:55:32 +00:00
usa 370ffc6a2a * ext/socket/extconf.rb: use headers instead of "netdb.h" in checking
getnameinfo() and getaddrinfo() because Windows doesn't have it.
	  see [ruby-dev:37757].

	* ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6
	  if INET6 is not defined.  winsock2's getaddrinfo() returns
	  sockaddr_in6 if ipv6 is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 17:59:45 +00:00
akr 91ff87c05d * ext/socket/socket.c (sock_s_unpack_sockaddr_in): check too short
sockaddr.
  (sock_s_unpack_sockaddr_un): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 16:00:03 +00:00
akr 73757753ae * ext/socket/socket.c (addrinfo_ip_unpack): new method
AddrInfo#ip_unpack.
  (addrinfo_unix_path): new method AddrInfo#unix_path.
  (Init_socket): define above methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 14:58:25 +00:00
akr 68552c4248 * ext/socket/socket.c (IS_IP_FAMILY): defined.
(addrinfo_ip_p): use it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 14:32:21 +00:00
akr 7099360a6c rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 06:57:54 +00:00
akr 5c94a67eca * ext/socket/mkconstants.rb: don't use bytesize because 1.9 dependent.
[ruby-core:21266]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 03:34:48 +00:00
nobu f914b5a7c2 * ext/socket/mkconstants.rb (c_str): get rid of a 1.9 feature for
cross compile.  [ruby-core:21243]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-11 00:53:03 +00:00
akr b802f1bb02 add constants.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 18:06:39 +00:00
akr 94c668f1ab rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 17:26:17 +00:00
akr 166c122fd3 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 17:16:51 +00:00
akr 7f52fa08b1 * ext/socket/mkconstants.rb: don't generate unintended newlines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 12:18:26 +00:00
akr 8a1261995e * ext/socket/mkconstants.rb: refactored to nest properly in statically
and dynamically.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-10 11:52:06 +00:00
akr ab8a2c7c1f * ext/socket/socket.c (sock_define_const): use INT2NUM.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-09 12:53:14 +00:00
usa f73dca932c * ext/socket/mkconstants.rb: define macro if default_value is passed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-09 06:41:07 +00:00
akr 80618e75aa * ext/socket/socket.c (bsock_shutdown): accept symbol/string as how.
(shutdown_how_arg): new function.

* ext/socket/mkconstants.rb: generate shutdown_how_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-08 14:20:47 +00:00
akr 2f31ea3c86 * ext/socket/mkconstants.rb (gen_name_to_int_func): generate
name_to_int functions, not only body.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-08 14:00:34 +00:00
akr c9ef4fc52f * ext/socket/socket.c: don't use AI_NUMERICSERV for platforms which
not define it as old Windows.
  [ruby-dev:37736]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-08 13:45:50 +00:00
akr 0dd41d0d78 * ext/socket/socket.c (init_unix_addrinfo): don't return a value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 22:53:41 +00:00
akr 3802c43ea1 * ext/socket/socket.c (addrinfo_getnameinfo): use NI_DGRAM if socktype
is SOCK_DGRAM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 15:27:09 +00:00
akr 69d908a10c * ext/socket/socket.c (host_str): add flags_ptr argument to specify
AI_NUMERICHOST if host is numeric form.
  (port_str): add flags_ptr argument to specify AI_NUMERICSERV if port
  is numeric form.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 15:21:43 +00:00
akr 55b2bf4dec * ext/socket/socket.c (rb_cAddrInfo): new class AddrInfo.
(s_recvfrom): return AddrInfo as address.
  (s_recvfrom_nonblock): ditto.
  (sock_accept): ditto.
  (sock_accept_nonblock): ditto.
  (sock_sysaccept): ditto.
  (bsock_send): accept AddrInfo as address argument.
  (sock_connect): ditto.
  (sock_connect_nonblock): ditto.
  (sock_bind): ditto.
  (sock_s_unpack_sockaddr_in): ditto.
  (sock_s_unpack_sockaddr_un): ditto.
  (bsock_local_address): new method BasicSocket#local_address.
  (bsock_remote_address): new method BasicSocket#remote_address.
  (addrinfo_initialize): new method AddrInfo#initialize.
  (addrinfo_inspect): new method AddrInfo#inspect.
  (addrinfo_afamily): new method AddrInfo#afamily.
  (addrinfo_pfamily): new method AddrInfo#pfamily.
  (addrinfo_socktype): new method AddrInfo#socktype.
  (addrinfo_protocol): new method AddrInfo#protocol.
  (addrinfo_to_sockaddr): new method AddrInfo#to_sockaddr.
  (addrinfo_canonname): new method AddrInfo#canonname.
  (addrinfo_ip_p): new method AddrInfo#ip?.
  (addrinfo_ipv4_p): new method AddrInfo#ipv4?.
  (addrinfo_ipv6_p): new method AddrInfo#ipv6?.
  (addrinfo_unix_p): new method AddrInfo#unix?.
  (addrinfo_getnameinfo): new method AddrInfo#getnameinfo.
  (addrinfo_s_getaddrinfo): new method AddrInfo.getaddrinfo.
  (addrinfo_s_tcp): new method AddrInfo.tcp.
  (addrinfo_s_udp): new method AddrInfo.udp.
  (addrinfo_s_unix): new method AddrInfo.unix.
  (Init_socket): define new class and methods.
  (sock_getaddrinfo): apply socktype hack regardless of ai_flags.
  (addrinfo_new): defined.
  (get_afamily): ditto.
  (fd_socket_addrinfo): ditto.
  (io_socket_addrinfo): ditto.
  (SockAddrStringValue): ditto.
  (SockAddrStringValuePtr): ditto.
  (sockaddr_string_value): ditto.
  (sockaddr_string_value_ptr): ditto.
  (rb_addrinfo_t): ditto.
  (addrinfo_mark): ditto.
  (addrinfo_free): ditto.
  (addrinfo_s_allocate): ditto.
  (IS_ADDRINFO): ditto.
  (check_addrinfo): ditto.
  (get_addrinfo): ditto.
  (alloc_addrinfo): ditto.
  (init_addrinfo): ditto.
  (addrinfo_new): ditto.
  (call_getaddrinfo): ditto.
  (init_addrinfo_getaddrinfo): ditto.
  (make_inspectname): ditto.
  (addrinfo_firstonly_new): ditto.
  (addrinfo_list_new): ditto.
  (init_unix_addrinfo): ditto.
  (ai_get_afamily): ditto.

* ext/socket/mkconstants.rb: generate intern_protocol_family,
  intern_socktype and intern_ipproto.

  [ruby-dev:37692]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 14:20:15 +00:00
nobu 3117bab125 * ext/socket/socket.c (ruby_getaddrinfo, ruby_getaddrinfo__aix):
constified.

* ext/socket/socket.c (ruby_getnameinfo__aix): protoized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 08:06:29 +00:00
nobu b5470fd243 * ext/socket/socket.c (io_call_close, io_close, pair_yield):
unused unless socketpair exists.

* ext/socket/getnameinfo.c (getnameinfo): moved conditinally used
  variable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-06 10:18:44 +00:00
akr d4a0895181 * ext/socket/socket.c (rb_getaddrinfo): defined for address lookup without GVL.
(struct getaddrinfo_arg): defined.
  (nogvl_getaddrinfo): defined.
  (rb_getnameinfo): defined for name lookup without GVL.
  (getnameinfo_arg): defined.
  (nogvl_getnameinfo): defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 13:38:58 +00:00
nobu 9ac6838183 * ext/socket/socket.c (constant_arg): constified.
* ext/socket/socket.c (optname_arg): cygwin does not have
  IPPROTO_IPV6.

* ext/socket/mkconstants.rb (ipv6_optname_to_int): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 00:27:43 +00:00
akr d51c5a137f * ext/socket/socket.c: redundant #ifdef removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-03 19:34:17 +00:00
akr a900ab57de * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] for
sock_s_getaddrinfo.
  (sock_getaddrinfo): add socktype_hack argument.
  (sock_addrinfo): call sock_getaddrinfo with socktype_hack.
  (sock_s_getaddrinfo): call sock_getaddrinfo without socktype_hack.
  [ruby-dev:37674]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 14:36:39 +00:00
akr e4b7c0e8a3 * ext/socket/mkconstants.rb: rename family_to_str to intern_family.
it returns ID now.

* ext/socket/socket.c (ipaddr): use intern_family.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:46:26 +00:00
akr b5aebd12c0 * ext/socket/mkconstants.rb: use ID in the values of
family_to_str_hash.  family_to_str returns a VALUE.

* ext/socket/socket.c (ipaddr): follow family_to_str change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:22:36 +00:00
akr 9ce8d4e3b9 * ext/socket/mkconstants.rb: refactored to gather stringizer
description.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:02:36 +00:00
akr 775d5d8f03 * ext/socket/mkconstants.rb: make common prefix optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 06:33:24 +00:00
akr d68b60741c * ext/socket/mkconstants.rb: use hash for family_to_str to avoid
linear search.  lenp argument removed.

* ext/socket/socket.c (ipaddr): call family_to_str without lenp
  argument.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 06:01:57 +00:00
akr 270f2034a7 * ext/socket/mkconstants.rb (gen_int_to_name): don't compare constants
in preprocessor because the constants may be enum.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 05:33:56 +00:00
akr 90a65796e7 * ext/socket/mkconstants.rb (gen_int_to_name): add lenp argument.
* ext/socket/socket.c (ipaddr): follow argument change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 05:12:14 +00:00
akr 28c2711230 * ext/socket/mkconstants.rb: check duplicates.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 19:43:49 +00:00
akr aa0ae0d3b6 * ext/socket/socket.c (optname_arg): defined.
(bsock_setsockopt): use optname_arg.
  (bsock_getsockopt): ditto.

* ext/socket/mkconstants.rb: generate so_optname_to_int,
  ip_optname_to_int, ipv6_optname_to_int, tcp_optname_to_int and
  udp_optname_to_int.
  more constants.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 17:40:41 +00:00
akr ff7e0f7f61 * ext/socket/socket.c (constant_arg): extracted from family_arg.
(family_arg): use constant_arg.
  (socktype_arg): ditto.
  (level_arg): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 17:09:35 +00:00
akr 59556a0849 * ext/socket/socket.c (level_arg): defined.
(bsock_setsockopt): use level_arg.
  (bsock_getsockopt): ditto.

* ext/socket/mkconstants.rb: generate level_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 16:16:08 +00:00
akr c6bbf28a9f * ext/socket/socket.c (family_arg): accept symbols as well.
(socktype_arg): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:59:10 +00:00
akr 31fa80dadd * ext/socket/socket.c (sock_s_getaddrinfo): use socktype_arg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:50:16 +00:00
akr f0dd0577b0 * ext/socket/socket.c (family_arg): extracted from
setup_domain_and_type.
  (socktype_arg): ditto.
  (udp_init): use family_arg.
  (sock_s_gethostbyaddr): ditto.
  (sock_s_getaddrinfo): ditto.
  (sock_s_getnameinfo): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:15:31 +00:00
akr e924cabede * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:26:57 +00:00
akr 85d13f6165 * ext/socket/mkconstants.rb: check all alias possibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:09:34 +00:00
akr 48649d21c9 * ext/socket/mkconstants.rb: more possible aliases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:00:13 +00:00
akr afb0581aa8 * ext/socket/mkconstants.rb: AF_ISO and AF_OSI may be aliased.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:55:05 +00:00
akr e485a566ed * ext/socket/socket.c (sock_s_getaddrinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:47:55 +00:00
akr 6e4149f04a * ext/socket/socket.c: include constants.h at top.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:18:18 +00:00
akr 10bc6f8d49 * ext/socket/mkconstants.rb: add valp argument for family_to_int and
socktype_to_int.

* ext/socket/socket.c (setup_domain_and_type): use valp argument.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 10:54:38 +00:00
akr 175561f8dd * ext/socket/mkconstants.rb: generate family_to_str.
* ext/socket/socket.c (ipaddr): use family_to_str.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 10:37:41 +00:00
akr 9787d4faae * ext/socket/mkconstants.rb: generate socktype_to_int.
* ext/socket/socket.c (setup_domain_and_type): use socktype_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:38:14 +00:00
akr 009ad25fdd * ext/socket/socket.c (setup_domain_and_type): initialize ptr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:27:41 +00:00
akr 7454eab701 * ext/socket/mkconstants.rb: refine family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:03:36 +00:00
akr 0c838b4947 * ext/socket/mkconstants.rb: generate family_to_int().
* ext/socket/socket.c (setup_domain_and_type): use family_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:49:31 +00:00
akr 89cf0ec1a6 * ext/socket/mkconstants.rb: generate init_constants function.
* ext/socket/socket.c (Init_socket): call init_constants.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:09:19 +00:00
akr 2b3e480bef * ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.
(Socket::PF_INET6): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:04:31 +00:00
akr 1c0e798d5c * ext/socket/mkconstants.rb: use erb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 06:28:34 +00:00
akr 212e90ce3a * ext/socket/mkconstants.rb: add -o option.
* ext/socket/depend: use mkconstants.rb with -o option.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 06:08:41 +00:00
akr ddedc6f125 * ext/socket/socket.c (sock_s_socketpair): yield if a block is given.
(io_call_close): defined.
  (io_close): defined.
  (pair_yield): defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 15:05:16 +00:00
akr a413e50c41 * ext/socket/mkconstants.rb: use sock_define_uconst for INADDR_*
constants because Socket::INADDR_LOOPBACK should be 0x7f000001
  instead of -0xffffff.

* ext/socket/socket.c (sock_define_uconst): defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 12:19:40 +00:00
matz 527cc92793 * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 08:14:35 +00:00
matz 445b6d5d01 * ext/socket/socket.c (s_recvfrom_nonblock): fixed awesome typo.
sorry.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 07:50:07 +00:00
matz 6dd1910a3d * ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to be
65536.  suggested by akr in [ruby-core:20918].  response to
  feature request #936 in [ruby-core:20917].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 07:32:56 +00:00
akr 0a3a98aea4 * ext/socket/socket.c (unix_recv_io): relax msg_controllen error
check.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-17 10:47:52 +00:00
matz 23e6fc744e * ext/socket/socket.c (sock_getaddrinfo): should have updated for
Mac OS X.  a patch from Shumpei Akai in [ruby-dev:37234]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-29 09:30:46 +00:00
matz 46e431e3eb * ext/socket/socket.c (sock_s_getaddrinfo): refactored to remove
code duplication regarding getaddrinfo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-28 09:32:20 +00:00
nobu 409293eb09 * ext/socket/socket.c (sock_s_getservbyport): check if the port range.
[ruby-core:19460]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 07:16:20 +00:00
nobu 472156c236 * ext/socket/socket.c (sock_s_getservbyname): unuse unnecessary
object.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 05:08:10 +00:00
nobu a5ea0e8c32 * ext/socket/socket.c (sock_s_getservbyport): the port should be
converted before the proto so that the #to_int of the former cannot
  alter the latter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 02:18:00 +00:00
usa 538d87cf11 * ext/socket/socket.c (sock_s_getservbyport): cast to get rid of
warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-23 00:27:52 +00:00
matz c1bb485ca0 * ext/socket/socket.c (sock_s_getservbyport): port should be
network byte order.  a patch from Dave Thomas in [ruby-core:19454].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 23:12:02 +00:00
shugo d423b884b8 * io.c, include/ruby/intern.h (rb_io_ascii8bit_binmode): externed.
* ext/socket/socket.c (init_sock): use rb_io_ascii8bit_binmode()
  instead of rb_io_binmode().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-21 04:31:15 +00:00
shugo 5545c5aafa * ext/socket/socket.c (init_sock): sockets should be binmode.
* test/socket/test_tcp.rb (test_encoding): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-17 02:50:43 +00:00
akr f59b1dfbfb rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-09 00:46:59 +00:00
yugui 8dd118c0db * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
* djgpp/README.djgpp: ditto.

* djgpp/config.hin: ditto.

* djgpp/config.sed: ditto.

* djgpp/configure.bat: ditto.

* djgpp/mkver.sed: ditto.

* ext/Setup.dj: ditto.

* dln.c: removed djgpp supports.

* file.c: ditto.

* gc.c: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* signal.c: ditto.

* util.c: ditto.

* vm_core.h: ditto.

* lib/fileutils.rb: ditto.

* lib/mkmf.rb: ditto.

* ext/socket/socket.c: ditto.

* test/fileutils/test_fileutils.rb: ditto.

* test/ruby/test_env.rb: ditto.

* test/ruby/test_path.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:25:12 +00:00
yugui bbbd9c0b7b * x68/_dtos18.c: removed. Ruby no longer supports human68k.
* x68/_round.c: ditto.

* x68/fconvert.c: ditto.

* x68/select.c: ditto.

* ext/Setup.x68: ditto.

* missing/x68.c: ditto.

* dln.c (dln_find_exe_r): removed human68k supports.
  (dln_find_1): ditto.

* lib/mkmf.rb: ditto.

* ext/extmk.rb (Init_ext): ditto.

* ext/socket/socket.c (init_sock): ditto.

* gc.c (GC_MALLOC_LIMIT): ditto.
  (rb_setjmp, rb_jmpbuf): ditto.
  (mark_current_machine_context): ditto.

* include/ruby/defines.h (PATH_ENV): ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* test/ruby/test_env.rb: ditto.

* test/ruby/test_path.rb: ditto.

* LEGAL


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:12:13 +00:00
nobu 34c7492e2c * ext/socket/socket.c (host_str): numeric address should be unsigned.
[ruby-core:18971]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26 18:12:43 +00:00
matz d7de44a8fc * dln.c: newer BeOS support. a patch from Pete Goodeve
<pete.goodeve at computer.org> in [ruby-core:18712].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 00:33:19 +00:00
matz 4c467da68f * ext/socket/mkconstants.rb: add new constants. a patch from
IWAMURO Motonori <deenheart+ruby at gmail.com> in [ruby-dev:36309].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16 03:13:14 +00:00
matz d98bc00582 * ext/socket/mkconstants.rb: add some IPV6 constans. [ruby-dev:36175]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 12:38:59 +00:00
ko1 204929af9d * include/ruby/signal.h: removed.
* common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c,
  io.c, process.c, signal.c: vm_core.h: ditto.
  Some unused external global variables are also removed.
  (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending,
  rb_thread_critical)
* ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c,
  ext/readline/readline.c, ext/socket/depend,
  ext/socket/socket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 08:00:05 +00:00
ko1 ca6a8b1e2c * include/ruby/intern.h: rename RB_UBF_DFL to
RUBY_UBF_IO and RUBY_UBF_PROCESS.
  Because there is no default (universal) unblocking function.
* ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 07:44:24 +00:00
nobu ae9af4d333 * ext/socket/socket.c (lookup_order_table): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 06:07:52 +00:00
nobu bb239558b8 * ext/coverage/coverage.c (rb_mCoverage): removed unneeded static variable.
* ext/socket/socket.c (unix_recv_io): ditto.

* ext/socket/socket.c (mConst): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 04:48:02 +00:00
akr 895fd7ec5e * include/ruby/io.h (rb_io_t): remove path field and add pathv field.
(MakeOpenFile): initialize pathv as Qnil.

* gc.c: mark pathv field in T_FILE.

* io.c: follow the rb_io_t field change.

* file.c: ditto.

* ext/socket/socket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 00:47:54 +00:00
nobu 0bf6ed0fc8 * ext/socket/getaddrinfo.c (getaddrinfo): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 05:08:51 +00:00
nobu a64266a728 * configure.in (rb_cv_missing__dtos18, rb_cv_missing_fconvert),
ext/digest/md5/md5.c, ext/openssl/ossl.c (main),
  ext/socket/extconf.rb (ipv6, wide-getaddrinfo): main should be int.

* main.c (main), win32/winmain.c, wince/wincemain.c (WinMain): envp is
  no longer used so long time.  based on a patch from Peter Bowen at
  [ruby-core:18208]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-09 23:15:08 +00:00
nobu 750cb61e65 * stable/ext/socket/socket.c (NI_MAXHOST, NI_MAXSERV): fixed invalid
preprocessor directives.  a patch from Peter Bowen at
  [ruby-core:18211].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-09 04:35:13 +00:00
usa c73a203040 * ext/socket/getaddrinfo.c (gai_strerror): ignore only on Haiku.
a patch from <znz at mbf.nifty.com>, [ruby-dev:35796].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-07 04:14:25 +00:00