1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

24 commits

Author SHA1 Message Date
usa
229b4e4c37 * ext/socket/socket.c (socket_s_ip_address_list): drop inactive
adapters.

	* test/socket/test_{nonblock,addrinfo,socket}.rb: skip some tests on
	  Windows.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 13:40:59 +00:00
akr
32004e3c46 don't use /tmp as example socket path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-18 14:04:54 +00:00
akr
758f9510a6 use IO::WaitWritable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19 12:45:40 +00:00
akr
c4049f4cb6 * io.c (rb_mWaitReadable): defined.
(rb_mWaitWritable): defined.
  (io_getpartial): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN.
  (rb_io_write_nonblock): extend IO::WaitWritable on EWOULDBLOCK and
  EAGAIN.

* error.c (make_errno_exc): extracted from rb_sys_fail.
  (rb_mod_sys_fail): new function.

* include/ruby/ruby.h (rb_mod_sys_fail): declared.
  (rb_mWaitReadable): declared.
  (rb_mWaitWritable): declared.

* ext/socket/init.c (rsock_s_recvfrom_nonblock): extend
  IO::WaitReadable on EWOULDBLOCK and EAGAIN.
  (rsock_s_accept_nonblock): extend IO::WaitReadable on EWOULDBLOCK,
  EAGAIN, ECONNABORTED and EPROTO.

* ext/socket/socket.c (sock_connect_nonblock): extend IO::WaitWritable
  on EINPROGRESS.

* ext/socket/ancdata.c (bsock_sendmsg_internal): extend
  IO::WaitWritable on EWOULDBLOCK and EAGAIN.
  (bsock_recvmsg_internal): extend IO::WaitReadable on EWOULDBLOCK and
  EAGAIN.

* ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): raise SSLError
  extended by IO::WaitReadable/IO::WaitWritable on
  SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE.

* ext/openssl/ossl.c (ossl_make_error): extracted from ossl_raise.
  (ossl_exc_new): new function.

* ext/openssl/ossl.h (ossl_exc_new): declared.

* lib/net/protocol.rb (rbuf_fill): rescue IO::WaitReadable and
  IO::WaitWritable.

  [ruby-core:22539], [ruby-dev:38140] 



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19 11:40:38 +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
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
akr
1643d1c28a add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03 06:12:23 +00:00
akr
2df1053c1d add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 23:30:46 +00:00
akr
352dcd9ee7 * test/socket/test_addrinfo.rb: use AddrInfo.getaddrinfo to generate
IPv6 address.  AddrInfo.ip generates IPv4 address for IPv4 mapped
  IPv6 address if --with-lookup-order-hack=INET.
  [ruby-dev:37868]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 10:59:17 +00:00
akr
f1137963e3 * ext/socket/raddrinfo.c (addrinfo_ipv4_private_p): new method.
(addrinfo_ipv4_loopback_p): ditto.
  (addrinfo_ipv4_multicast_p): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 12:28:50 +00:00
akr
849e730f15 * ext/socket/raddrinfo.c (addrinfo_ipv6_unspecified_p): new method.
(addrinfo_ipv6_loopback_p): ditto.
  (addrinfo_ipv6_multicast_p): ditto.
  (addrinfo_ipv6_linklocal_p): ditto.
  (addrinfo_ipv6_sitelocal_p): ditto.
  (addrinfo_ipv6_v4mapped_p): ditto.
  (addrinfo_ipv6_v4compat_p): ditto.
  (addrinfo_ipv6_mc_nodelocal_p): ditto.
  (addrinfo_ipv6_mc_linklocal_p): ditto.
  (addrinfo_ipv6_mc_sitelocal_p): ditto.
  (addrinfo_ipv6_mc_orglocal_p): ditto.
  (addrinfo_ipv6_mc_global_p): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31 11:09:51 +00:00
akr
db881044bc * ext/socket/raddrinfo.c (addrinfo_inspect_sockaddr): new
method AddrInfo#inspect_sockaddr.
  (inspect_sockaddr): extracted from addrinfo_inspect.
  (addrinfo_inspect): use inspect_sockaddr.
  (Init_addrinfo): define the new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 08:03:24 +00:00
akr
d620500dda * ext/socket/raddrinfo.c (addrinfo_ip_address): new method
AddrInfo#ip_address.
  (addrinfo_ip_port): new method AddrInfo#ip_port.
  (Init_addrinfo): define the methods above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 07:47:35 +00:00
akr
86aa5043d8 * ext/socket/raddrinfo.c (addrinfo_mdump): new method.
(addrinfo_mload): new method.
  (Init_addrinfo): define the method above.

* ext/socket/constants.c (constant_arg): str_to_int's first argument
  constified.

* ext/socket/mkconstants.rb (gen_name_to_int_decl): generated
  function's first argument constified.
  (gen_name_to_int_func_in_guard): ditto.
  (ipproto_to_int): generated.

* ext/socket/rubysocket.h (IS_IP_FAMILY): moved from raddrinfo.c.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 18:14:34 +00:00
akr
e2f8800667 * ext/socket/socket.c (sock_s_getnameinfo): accept AddrInfo object.
* ext/socket/raddrinfo.c (rb_check_sockaddr_string_type): defined.

* ext/socket/rubysocket.h (rb_check_sockaddr_string_type): declared.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17 16:39:03 +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
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
839214e1e6 add test for AddrInfo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-12 08:52:37 +00:00