akr
8ce4a284e4
* ext/socket/socket.c (rsock_socketpair): extracted from
...
rsock_sock_s_socketpair.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 14:49:57 +00:00
akr
1a70dfe6f4
* include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
...
rb_fd_set_cloexec.
* io.c: follow the above renaming.
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 12:49:16 +00:00
akr
b574a4d4a1
* include/ruby/intern.h (rb_fd_set_cloexec): declared.
...
* io.c (rb_fd_set_cloexec): new function.
(ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
(rb_sysopen_internal): ditto.
(rb_pipe): ditto.
(io_reopen): ditto.
(io_cntl): ditto.
* process.c (rb_f_exec): change the default :close_others option to
true.
(rb_f_system): ditto.
(move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
close-on-exec flag.
(ruby_setsid): ditto.
(rb_daemon): ditto.
* thread_pthread.c (rb_thread_create_timer_thread): call
rb_fd_set_cloexec to set close-on-exec flag.
* ruby.c (load_file_internal): ditto.
* file.c (rb_file_s_truncate): ditto.
(file_load_ok): ditto.
* random.c (fill_random_seed): ditto.
* ext/pty/pty.c (chfunc): ditto.
(get_device_once): ditto.
* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.
* ext/socket/init.c (rsock_socket): ditto.
(rsock_s_accept_nonblock): ditto.
(rsock_s_accept): ditto.
* ext/socket/socket.c (rsock_sock_s_socketpair): ditto.
* ext/socket/ancdata.c (discard_cmsg): ditto.
(make_io_for_unix_rights): ditto.
* ext/socket/unixsocket.c (unix_recv_io): ditto.
* ext/io/console/console.c (console_dev): ditto.
[ruby-core:38140] [Feature #5041 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22 09:58:15 +00:00
drbrain
1297942451
* 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/trunk@32977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15 23:08:39 +00:00
akr
b41ccc4a9c
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 13:26:10 +00:00
nobu
4822d20cc5
* ext/socket: fixed types.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 08:14:13 +00:00
nobu
977267c2e0
* ext/**/*.[ch]: removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
akr
a4fa54a10a
* ext/socket: use rsock_ prefix for internal initialization functions.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22 16:15:21 +00:00
akr
652484598d
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22 09:45:57 +00:00
akr
1561d3fb8b
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22 03:33:14 +00:00
akr
062780c834
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22 00:48:51 +00:00
akr
daa739876f
* ext/socket: make sources rdoc friendly.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-21 10:50:52 +00:00
akr
7e833da5fe
* ext/socket/socket.c (socket_s_ip_address_list): obtain the scope_id
...
of IPv6 link local address on OpenSolaris.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-08 12:08:45 +00:00
nobu
af2f1bf4f9
* ext/socket/ipsocket.c (ip_addr, ip_peeraddr),
...
ext/socket/socket.c (sock_s_getaddrinfo): added optional
reverse_lookup flag. [ruby-core:28007]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06 02:35:11 +00:00
akr
8458c38590
update rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-31 09:03:08 +00:00
nobu
1069e0f335
* ext/socket/extconf.rb: fix for wide-getaddrinfo option.
...
* ext/socket/addrinfo.c: rename {addr,name}info functions to ensure
those are used on darwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-30 20:56:41 +00:00
akr
9c4ac94a8e
fix typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-04 12:02:37 +00:00
wanabe
24a6752f54
* ext/socket/socket.c (socket_s_ip_address_list): use FreeLibrary() to
...
free HMODULE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01 04:24:47 +00:00
naruse
438b8706a7
* ext/bigdecimal/bigdecimal.c (VpMidRound): remove warnings.
...
patch from Charlie Savage. [ruby-core:22869]
* ext/digest/bubblebabble/bubblebabble.c (bubblebabble_str_new): ditto.
* ext/digest/digest.c (hexencode_str_new): ditto.
* ext/iconv/iconv.c (iconv_convert): ditto.
* ext/socket/socket.c (inspect_sockaddr): ditto.
* ext/socket/raddrinfo.c (sockaddr_obj): ditto.
* ext/syck/emitter.c (syck_emitter_write): ditto.
* ext/syck/emitter.c (syck_emitter_flush): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 04:36:31 +00:00
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
05a278b4cd
* ext/readline/readline.c: use rb_f_notimplement for methods not
...
implemented.
* ext/openssl/ossl_engine.c: ditto.
* ext/openssl/ossl_config.c: ditto.
* ext/openssl/ossl_cipher.c: ditto.
* ext/openssl/ossl_pkcs5.c: ditto.
* ext/openssl/ossl_x509ext.c: ditto.
* ext/socket/socket.c: ditto.
* ext/socket/basicsocket.c: ditto.
* ext/socket/ancdata.c: ditto.
* ext/socket/unixsocket.c: ditto.
* ext/iconv/iconv.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-18 14:10:06 +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
4f39e639f4
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-04 22:19:33 +00:00
akr
d79dc0f6a0
* ext/socket/raddrinfo.c: suppress warnings.
...
* ext/socket/socket.c: ditto.
* ext/socket/unixsocket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01 14:00:48 +00:00
akr
172d208789
* ext/socket/ (rsock_make_hostent): renamed from sock_make_hostent.
...
(rsock_addrinfo): renamed from sock_addrinfo.
(rsock_getaddrinfo): renamed from sock_getaddrinfo.
(rsock_socket): renamed from ruby_socket.
(rsock_sock_s_socketpair): renamed from sock_s_socketpair.
(rsock_connect): renamed from ruby_connect.
* ext/socket/socket.c (sock_listen): make it static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01 06:48:22 +00:00
akr
c49f05dd79
* ext/socket: add rsock_prefix.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01 06:30:41 +00:00
akr
5fb1faf2bf
* ext/socket/raddrinfo.c: suppress strict-aliasing warning with
...
gcc version 4.4.0 20090219 (Red Hat 4.4.0-0.21) on Fedora 11 Alpha.
* ext/socket/socket.c: ditto.
* ext/socket/unixsocket.c: ditto.
* ext/socket/sockport.h (SS_LEN): defined.
(SET_SS_LEN): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27 15:21:23 +00:00
akr
470103861e
add comment.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 13:19:04 +00:00
akr
0ae09794e5
* ext/socket/socket.c (sockaddr_obj): convert fe80:1::1 to fe80::1%1.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 13:02:59 +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
36dcff1cf5
* ext/socket/socket.c (Init_socket): define TCPServer#listen and
...
UNIXServer#listen here for rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13 12:14:00 +00:00
akr
be25c48638
* ext/socket/socket.c (sock_gethostname): use HOST_NAME_MAX.
...
* ext/socket/raddrinfo.c (make_ipaddr): local variable renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 15:39:16 +00:00
akr
2ee0859119
* ext/socket/init.c (struct recvfrom_arg): use struct
...
sockaddr_storage.
(recvfrom_blocking): follow struct recvfrom_arg change.
(s_recvfrom): ditto.
(s_recvfrom_nonblock): use struct sockaddr_storage.
* ext/socket/socket.c (sock_accept): use struct sockaddr_storage.
(sock_accept_nonblock): ditto.
(sock_sysaccept): ditto.
* ext/socket/ancdata.c (bsock_recvmsg_internal): use struct
sockaddr_storage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 14:46:51 +00:00
akr
a038fab649
* ext/socket/socket.c (sockaddr_obj): fill pfamily.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 12:15:54 +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
5ce10c1359
* ext/socket/socket.c (sock_s_socketpair): make 3rd argument optional.
...
* ext/socket/unixsocket.c (unix_s_socketpair): follow the above
change.
* ext/socket/rubysocket.h (sock_s_socketpair): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 16:20:05 +00:00
akr
5ad05f37a5
* ext/socket/socket.c (sock_initialize): make 3rd argument, protocol,
...
optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02 05:55:56 +00:00
usa
68db4a3464
* ext/socket/spclet.c (socket_s_ip_address_list): support Windows XP
...
or later. (Win2k or earlier is still not supported)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-29 02:25:39 +00:00
akr
efdef4dbe2
* ext/socket/socket.c (socket_s_ip_address_list): renamed from
...
socket_s_list_ip_address. [ruby-dev:37806]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25 07:36:45 +00:00
nobu
45c4ae9b8b
* ext/socket/socket.c (socket_s_list_ip_address): constified.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25 03:33:54 +00:00
akr
bd3cdcf394
* ext/socket/socket.c (socket_s_list_ip_address): new method.
...
(sockaddr_obj): new function.
* ext/socket/rubysocket.h: include ifaddrs.h, sys/ioctl.h,
sys/sockio.h, net/if.h if available.
(addrinfo_new): declared.
* ext/socket/raddrinfo.c (addrinfo_new): exported.
* ext/socket/extconf.rb: check ifaddrs.h, sys/ioctl.h, sys/sockio.h,
net/if.h and getifaddrs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-20 11:19:09 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
naruse
48e21d2051
* eval_intern.h: Add support to Haiku. see [ruby-core:18110]
...
* include/ruby/defines.h: ditto.
* configure.in: ditto.
* thread_pthread.c: ditto.
* io.c: ditto.
* lib/mkmf.rb: ditto.
* ext/socket/getaddrinfo.c: ditto.
* ext/socket/extconf.rb: ditto.
* ext/socket/socket.c: ditto.
* ext/socket/addrinfo.h: ditto.
* ext/socket/getnameinfo.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-06 20:52:44 +00:00
usa
e4d911fa98
* ext/socket/socket.c (connect_blocking, socks_connect_blocking,
...
ruby_connect): cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 07:09:34 +00:00
usa
fae330b3b9
* ext/socket/socket.c (ruby_connect): select() for connect() has
...
mean only when the socket is non-blocking.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 07:49:51 +00:00
usa
c9eba6932b
* ext/socket/socket.c (ruby_connect, s_accept): came back blocking
...
region because other thread/process maybe read/write the socket
between select() and connect()/accept().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-15 12:34:58 +00:00
usa
57331140f6
* ext/socket/socket.c (ruby_connect, s_accept): no need to wrap by
...
blocking region if checked before readable/writable by select.
* ext/socket/socket.c (bsock_send, s_recvfrom, udp_send, unix_send_io,
unix_recv_io): should check readable/writable before blocking calling
blocking functions.
see [ruby-dev:35446]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-15 09:17:22 +00:00
akr
97208f2b34
* ext/socket/socket.c: use PRIuSIZE.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-12 14:25:52 +00:00
nobu
2754e843b6
* ext/socket/socket.c (bsock_send, s_recvfrom, ruby_connect, s_accept),
...
(udp_send, unix_send_io, unix_recv_io): blocking region support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-06 14:49:00 +00:00
akr
890aa092be
* ext/socket/socket.c (host_str): fix type mismatch in rb_raise
...
format and argument.
(port_str): ditto.
(unix_recv_io): ditto.
(sock_s_unpack_sockaddr_un): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05 15:58:46 +00:00
usa
1a13281ab7
* ext/socket/socket.c (init_sock): socket is binmode on platforms
...
which support binmode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 00:41:38 +00:00
nobu
f8ef02adc4
* ext/socket/socket.c: constified.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 09:51:21 +00:00
akr
6cdef2dc7e
* $Date$ keyword removed to avoid inclusion of locale dependent
...
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
akr
0352d32f05
* util.c (ruby_strtoul): locale independent strtoul is implemented to
...
avoid "i".to_i(36) cause 0 under tr_TR locale.
This is newly implemented, not a copy of missing/strtoul.c.
* include/ruby/ruby.h (ruby_strtoul): declared.
(STRTOUL): defined to use ruby_strtoul.
* bignum.c, pack.c, ext/socket/socket.c: use STRTOUL.
* configure.in (strtoul): don't check.
* missing/strtoul.c: removed.
* include/ruby/missing.h (strtoul): removed.
* common.mk (strtoul.o): removed.
* LEGAL (missing/strtoul.c): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-02 06:24:27 +00:00
akr
f80bb164ce
use EWOULDBLOCK as an example in document.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-29 19:22:14 +00:00
matz
5458a384ea
* ext/socket/socket.c: a patch to support IRIX from Andrew
...
Thompson <andrew@hijacked.us> in [ruby-core:14447].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27 01:47:11 +00:00
akr
124bdf8815
rescue Errno::EWOULDBLOCK as well as Errno::EAGAIN in sample code in rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-23 07:40:56 +00:00
akr
297d2e05cb
* ext/socket/socket.c (s_accept_nonblock): make accepted fd
...
nonblocking. [ruby-talk:274079]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 16:18:41 +00:00
matz
a25fbe3b3e
* encoding.c: provide basic features for M17N.
...
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 03:29:39 +00:00
nobu
2b592580bf
* include/ruby: moved public headers.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10 03:06:15 +00:00
akr
24af397fcd
clear cmsg padding.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 13:37:55 +00:00
akr
e3b9378f38
* ext/socket/socket.c (unix_send_io, unix_recv_io): use CMSG_DATA to
...
align file descriptor appropriately.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 10:55:01 +00:00
usa
eed46ac633
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
...
windows) doesn't set fromlen if the socket is connection-oriented.
reported by Bram Whillock in [ruby-core:10512] [ruby-Bugs#9061]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-03 06:50:41 +00:00
matz
33163ad123
* regparse.c, etc.: K&R to ANSI code cleanup patch from Stefan
...
Huehner <stefan at huehner.org>. [ruby-core:10543]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-19 03:58:57 +00:00
nobu
5b10c170e5
* file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
...
renamed from OpenFile.
* ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
ext/readline/readline.c, ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 10:30:50 +00:00
matz
2551d9b534
* ext/socket/socket.c (unix_peeraddr): wrong syscall name in error
...
message for #peeraddr. a patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:10366]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-19 08:17:14 +00:00
matz
76a27adfda
* ext/socket/socket.c (init_unixsock): path may contain NUL for
...
abstract unix sockets. [ruby-core:10288]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-13 15:31:18 +00:00
matz
06720d45c7
* ext/socket/socket.c: fix errors in socket sample code.
...
[ruby-core:09992]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-22 06:01:17 +00:00
matz
66b90161cf
* ext/socket/socket.c (ruby_getnameinfo__aix): AF_INET6 workaround
...
for AIX. a patch from Yutaka Kanemoto <kinpoco AT gmail.com>.
[ruby-dev:29744]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-02 15:38:59 +00:00
matz
9856258cd0
socket.c: a rdoc patch from Daniel Berger <djberg96 at gmail.com>
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-26 23:31:35 +00:00
akr
f80cbcf912
* ext/socket/socket.c (ruby_connect): sockerrlen should be socklen_t.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 21:27:16 +00:00
akr
c76ff0753e
* ext/socket/extconf.rb: check arpa/inet.h for ntohs.
...
* ext/socket/socket.c: include arpa/inet.h if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 19:44:42 +00:00
matz
2156870525
* ruby.h (struct RArray): embed small arrays.
...
(RARRAY_LEN): defined for accessing array members.
(RARRAY_PTR): ditto.
* array.c: use RARRAY_LEN and RARRAY_PTR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 14:42:08 +00:00
matz
85c476a342
* ext/socket/socket.c (socks_init): typo fixed. a patch from Sven
...
Klemm <sven at c3d2.de>. [ruby-core:08770]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-01 12:45:01 +00:00
matz
25c50cd193
* ruby.h (struct RString): embed small strings.
...
(RSTRING_LEN): defined for accessing string members.
(RSTRING_PTR): ditto.
* string.c: use RSTRING_LEN and RSTRING_PTR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 10:30:33 +00:00
akr
4bc2a9860c
* ext/socket/socket.c: ANSIfied. [ruby-core:08601]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-13 03:09:59 +00:00
matz
50ef220b5a
* configure.in, common.mk: AIX link issue. a patch from Yutaka
...
Kanemoto <kinpoco at gmail.com>. [ruby-dev:29190]
* ext/socket/socket.c: AIX socket support. [ruby-dev:29190]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-07 05:44:43 +00:00
matz
471e41ec70
* string.c: RDoc update for =~ method. a patch from Alex Young
...
<alex at blackkettle.org>. [ruby-core:08068]
* io.c (pipe_open): backout unnecessary fix on 2006-06-26.
[ruby-dev:28865]
* eval.c (rb_yield_0): exact argument number check now done only
for lambda Proc.
* eval.c (rb_yield_0): add check for number of arguments, if
there's one lambda block parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 14:14:25 +00:00
akr
b73e6801e3
* ext/socket/socket.c (bsock_recv_nonblock): new method
...
BasicSocket#recv_nonblock.
(udp_recvfrom_nonblock): renamed from ip_recvfrom_nonblock.
IPSocket#recvfrom_nonblock is moved to UDPSocket#recvfrom_nonblock.
(unix_recvfrom_nonblock): removed.
UNIXSocket#recvfrom_nonblock is removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 16:39:59 +00:00
akr
429cb7c025
revert sock_sysaccept addition to [ruby-dev:28861].
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 15:09:45 +00:00