summaryrefslogtreecommitdiffstats
path: root/ext/socket/socket.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] forakr2009-01-021-4/+4
| | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@21278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: rename family_to_str to intern_family.akr2009-01-021-3/+4
| | | | | | | | | | it returns ID now. * ext/socket/socket.c (ipaddr): use intern_family. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: use ID in the values ofakr2009-01-021-4/+4
| | | | | | | | | | family_to_str_hash. family_to_str returns a VALUE. * ext/socket/socket.c (ipaddr): follow family_to_str change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: use hash for family_to_str to avoidakr2009-01-021-1/+1
| | | | | | | | | | | linear search. lenp argument removed. * ext/socket/socket.c (ipaddr): call family_to_str without lenp argument. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (gen_int_to_name): add lenp argument.akr2009-01-021-1/+1
| | | | | | | | * ext/socket/socket.c (ipaddr): follow argument change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (optname_arg): defined.akr2009-01-011-3/+22
| | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@21261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (constant_arg): extracted from family_arg.akr2009-01-011-53/+19
| | | | | | | | | | (family_arg): use constant_arg. (socktype_arg): ditto. (level_arg): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (level_arg): defined.akr2009-01-011-2/+28
| | | | | | | | | | | (bsock_setsockopt): use level_arg. (bsock_getsockopt): ditto. * ext/socket/mkconstants.rb: generate level_to_int. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (family_arg): accept symbols as well.akr2009-01-011-4/+12
| | | | | | | (socktype_arg): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getaddrinfo): use socktype_arg.akr2009-01-011-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (family_arg): extracted fromakr2009-01-011-58/+57
| | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@21254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int.akr2009-01-011-8/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getaddrinfo): use family_to_int.akr2009-01-011-8/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c: include constants.h at top.akr2009-01-011-10/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: add valp argument for family_to_int andakr2009-01-011-10/+4
| | | | | | | | | | socktype_to_int. * ext/socket/socket.c (setup_domain_and_type): use valp argument. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: generate family_to_str.akr2009-01-011-23/+7
| | | | | | | | * ext/socket/socket.c (ipaddr): use family_to_str. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: generate socktype_to_int.akr2009-01-011-21/+5
| | | | | | | | * ext/socket/socket.c (setup_domain_and_type): use socktype_to_int. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (setup_domain_and_type): initialize ptr.akr2009-01-011-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: generate family_to_int().akr2009-01-011-42/+6
| | | | | | | | * ext/socket/socket.c (setup_domain_and_type): use family_to_int. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: generate init_constants function.akr2009-01-011-1/+3
| | | | | | | | * ext/socket/socket.c (Init_socket): call init_constants. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.akr2009-01-011-4/+0
| | | | | | | (Socket::PF_INET6): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_socketpair): yield if a block is given.akr2008-12-311-2/+26
| | | | | | | | | | (io_call_close): defined. (io_close): defined. (pair_yield): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: use sock_define_uconst for INADDR_*akr2008-12-301-0/+9
| | | | | | | | | | | constants because Socket::INADDR_LOOPBACK should be 0x7f000001 instead of -0xffffff. * ext/socket/socket.c (sock_define_uconst): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162.matz2008-12-291-6/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (s_recvfrom_nonblock): fixed awesome typo.matz2008-12-291-1/+1
| | | | | | sorry. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (s_recvfrom_nonblock): default maxlen to bematz2008-12-291-2/+7
| | | | | | | 65536. suggested by akr in [ruby-core:20918]. response to feature request #936 in [ruby-core:20917]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (unix_recv_io): relax msg_controllen errorakr2008-12-171-2/+7
| | | | | | | | check. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_getaddrinfo): should have updated formatz2008-11-291-1/+1
| | | | | | Mac OS X. a patch from Shumpei Akai in [ruby-dev:37234] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getaddrinfo): refactored to removematz2008-11-281-37/+18
| | | | | | code duplication regarding getaddrinfo. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getservbyport): check if the port range.nobu2008-10-231-0/+4
| | | | | | | [ruby-core:19460] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getservbyname): unuse unnecessarynobu2008-10-231-7/+7
| | | | | | | object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getservbyport): the port should benobu2008-10-231-4/+6
| | | | | | | | converted before the proto so that the #to_int of the former cannot alter the latter. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getservbyport): cast to get rid ofusa2008-10-231-1/+1
| | | | | | | | warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_getservbyport): port should bematz2008-10-221-1/+1
| | | | | | network byte order. a patch from Dave Thomas in [ruby-core:19454]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, include/ruby/intern.h (rb_io_ascii8bit_binmode): externed.shugo2008-10-211-1/+1
| | | | | | | | * ext/socket/socket.c (init_sock): use rb_io_ascii8bit_binmode() instead of rb_io_binmode(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (init_sock): sockets should be binmode.shugo2008-10-171-3/+1
| | | | | | | * test/socket/test_tcp.rb (test_encoding): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-10-091-7/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.yugui2008-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * x68/_dtos18.c: removed. Ruby no longer supports human68k.yugui2008-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (host_str): numeric address should be unsigned.nobu2008-09-261-1/+1
| | | | | | | [ruby-core:18971] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: newer BeOS support. a patch from Pete Goodevematz2008-09-191-1/+1
| | | | | | <pete.goodeve at computer.org> in [ruby-core:18712]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-1/+0
| | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: rename RB_UBF_DFL toko12008-08-311-1/+1
| | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (lookup_order_table): constified.nobu2008-08-311-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/coverage/coverage.c (rb_mCoverage): removed unneeded static variable.nobu2008-08-311-6/+6
| | | | | | | | | * ext/socket/socket.c (unix_recv_io): ditto. * ext/socket/socket.c (mConst): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): remove path field and add pathv field.akr2008-08-231-6/+8
| | | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * stable/ext/socket/socket.c (NI_MAXHOST, NI_MAXSERV): fixed invalidnobu2008-08-091-2/+2
| | | | | | | | preprocessor directives. a patch from Peter Bowen at [ruby-core:18211]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h: Add support to Haiku. see [ruby-core:18110]naruse2008-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@18402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (connect_blocking, socks_connect_blocking,usa2008-07-221-3/+3
| | | | | | | | ruby_connect): cast. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (ruby_connect): select() for connect() hasusa2008-07-171-1/+0
| | | | | | | | mean only when the socket is non-blocking. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e