summaryrefslogtreecommitdiff
path: root/ext/socket/init.c
AgeCommit message (Collapse)Author
2011-10-31* ext/socket/init.c (rsock_socket): use SOCK_CLOEXEC if available.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* include/ruby/intern.h (rb_fd_fix_cloexec): renamed fromakr
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-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* 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-08-15* ext/socket: Make Socket documentation appear. Add documentation fordrbrain
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-07-20* include/ruby/intern.h (rb_update_max_fd): declaration moved fromakr
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-05-04* ext/socket/init.c (wait_connectable): fix error handling code.kosaki
RB_WAITFD_OUT is turned on even though an error occur. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* ext/socket/init.c (wait_connectable): use rb_wait_for_single_fd().kosaki
The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] * ext/socket/init.c (try_wait_connectable, wait_connectable_ensure): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-01* ext/socket/init.c (rsock_connect): add to care EINTR. basedkosaki
on a patch from Eric Wong at [ruby-core:35621][Bug #4555] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* include/ruby/intern.h (rb_thread_select): mark as deprecated.kosaki
* ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select instead of rb_thread_select. * ext/socket/init.c (wait_connectable0): ditto. * ext/readline/readline.c (readline_event): ditto. * io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable, wait_writable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* ext/socket/init.c (rsock_init_sock): conditionally used variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28* ext/socket: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22* ext/socket: use rsock_ prefix for internal initialization functions.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02* ext/socket/socket.c: turn on do_not_reverse_lookup by default,nobu
which has been reverted in r9880 probably unintentionally, according to matz. [ruby-core:24530] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-15* ext/socket/init.c (rsock_init_sock): mswin doesn't have S_IFSOCKusa
flag in st_mode of struct stat. so, use rb_w32_issocket() function instead of S_ISSOCK macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-14* ext/socket/init.c (rsock_init_sock): validate file descriptor.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17* ext/socket/init.c (rsock_getfamily): return AF_UNSPEC if getsocknameakr
is failed. [ruby-core:24383] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19* io.c (rb_mWaitReadable): defined.akr
(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-13* ext/socket/init.c (wait_connectable0): remove unreachable code.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01* ext/socket/ (rsock_getfamily): renamed from rb_sock_getfamily.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-01* ext/socket/ (rsock_make_hostent): renamed from sock_make_hostent.akr
(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* ext/socket: add rsock_prefix.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22* ext/socket/init.c (s_recvfrom): use rb_io_wait_readable afterakr
recvfrom. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22* ext/socket/init.c (s_recvfrom_nonblock): handles EAGAIN too.nobu
* ext/socket/init.c (s_accept_nonblock): ditto, and EPROTO depends on platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-21* io.c (io_getpartial): error message describes what should beakr
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-10* ext/socket/init.c (struct recvfrom_arg): use structakr
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-09* ext/socket/rubysocket.h (level_arg): add family argument.akr
(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-05* ext/socket: AddrInfo is renamed to Addrinfo. [ruby-dev:37876]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02* ext/socket/rubysocket.h (cmsg_type_arg): declared.akr
(Init_ancdata): ditto. * ext/socket/init.c (Init_socket_init): call Init_ancdata. * ext/socket/constants.c (cmsg_type_arg): defined. * ext/socket/depend: add dependency for ancdata.o. * ext/socket/mkconstants.rb: generate scm_optname_to_int. more constants. * ext/socket/extconf.rb: add ancdata.o. * ext/socket/ancdata.c: new file. new method BasicSocket#{sendmsg,sendmsg_nonblock,recvmsg,recvmsg_nonblock} git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02* ext/socket/rubysocket.h (rb_cSockOpt): declared.akr
(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-01-27* ext/socket/init.c (socks_connect_blocking): moved fromakr
sockssocket.c. [ruby-dev:37834] * sockssocket.c (socks_init): don't omit "int" type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-17* ext/socket: split files for each class.akr
* 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