aboutsummaryrefslogtreecommitdiffstats
path: root/ext/socket
Commit message (Collapse)AuthorAgeFilesLines
* * ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.mame2013-10-021-0/+4
| | | | | | | | | When a system had no interface, this function used xmalloc for root but did not return any reference to it. This patch fixes it by immediately returning an empty array if no interface is found. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: define MSG_FASTOPEN.glass2013-09-151-0/+1
| | | | | | [ruby-core:57138] [Feature #8897] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: Remove spaces between SI prefix and unit to followakr2013-09-091-2/+2
| | | | | | | | | | | | | | SI brochure. http://www.bipm.org/en/si/si_brochure/ https://www.nmij.jp/library/units/si/ * time.c: Ditto. * ext/socket/ancdata.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (TCP_FASTOPEN): Defined for TCP fast open.akr2013-09-071-0/+1
| | | | | | | [ruby-core:57048] [Feature #8871] patch by Masaki Matsushita. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/unixserver.c: [DOC] Document #acceptzzak2013-08-194-17/+19
| | | | | | | | | | * ext/socket/tcpserver.c: ditto * ext/socket/udpsocket.c: [DOC] Fix indentation of documentation * ext/socket/socket.c: ditto Patches by David Rodríguez [ruby-core:56734] [Bug #8802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ipsocket.c (init_inetsock_internal): Don't try mismachedakr2013-07-011-1/+1
| | | | | | | | address family if already failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ipsocket.c (init_inetsock_internal): Use an addressakr2013-07-011-2/+7
| | | | | | | | | family for local address wihch is different to the remote address if no other choice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ipsocket.c (init_inetsock_internal): Don't use localakr2013-06-281-3/+12
| | | | | | | | addresses which address family is different to remote address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS Xdrbrain2013-06-121-0/+5
| | | | | | | 10.7+. [ruby-trunk - Bug #8517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo2013-06-124-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.kou2013-06-101-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing returnkou2013-06-101-1/+1
| | | | | | | value assignment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntunaruse2013-06-101-1/+10
| | | | | | 13.04's getaddrinfo issue with mdns4. [ruby-list:49420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/option.c: rename functions introduced in r41009naruse2013-06-021-31/+28
| | | | | | | | s/ip/ipv4/g because they are ipv4 functions. (there's a policy that the name "ip" is for methods which supports both ipv4 and ipv6) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/option.c (inspect_byte): used only on NetBSD.nobu2013-05-311-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/option.c (sockopt_s_byte): constructor of the sockoptnaruse2013-05-311-0/+203
| | | | | | | | | | | | | | | | | | | | | | whose value's is byte. * ext/socket/option.c (sockopt_byte): getter for above. * ext/socket/option.c (inspect_byte): inspect for above. * ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of the sockopt whose optname is IP_MULTICAST_LOOP. * ext/socket/option.c (sockopt_ip_multicast_loop): getter for above. * ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of the sockopt whose optname is IP_MULTICAST_TTL. * ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above. * ext/socket/option.c (sockopt_inspect): use above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.akr2013-05-181-6/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.akr2013-05-181-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:akr2013-05-181-2/+2
| | | | | | | | comparison between signed and unsigned integer expressions git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.akr2013-05-181-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: Convert integer constants bigger than intakr2013-05-171-13/+14
| | | | | | | | correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flagsakr2013-05-171-4/+19
| | | | | | | | because SunOS 5.11 (OpenIndiana) defines ifa_flags as uint64_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable the document for Socket::Ifaddr#ifindex.akr2013-05-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a dependency.akr2013-05-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/depend: Add a dependency for ifaddr.o.akr2013-05-151-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/.document: Add ifaddr.c.akr2013-05-141-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket: fix build error and warnings on mingwnobu2013-05-143-1/+25
| | | | | | | | | | | | * ext/socket/extconf.rb: check for if_nametoindex() for i686-w64-mingw32, and check for declarations of if_indextoname() and if_nametoindex(). * ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless if_nametoindex() is available. * ext/socket/rubysocket.h: declare if_indextoname() and if_nametoindex() if available but not declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update doc.akr2013-05-141-18/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Check socketpair again.akr2013-05-131-0/+1
| | | | | | | | It is required on Unix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]usa2013-05-131-5/+0
| | | | | | | | | | | | | | | emulate getipaddrs(3) on Unix. * win32/Makefile.sub, configure.in (LIBS): need iphlpapi.lib for above function. * include/ruby/win32.h (socketpair): rb_w32_socketpair() doesn't substitute for any function, so use non-prefixed name. * ext/socket/extconf.rb (socketpair); follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: constify RBasic::klass and addko12013-05-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/rubysocket.h (rsock_inspect_sockaddr): as r40646naruse2013-05-121-1/+1
| | | | | | check HAVE_TYPE_STRUCT_SOCKADDR_DL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fixed wrong document for Socket.tcp by @lann [fix GH-302]hsbt2013-05-121-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* raddrinfo.c: suppress warningsnobu2013-05-111-2/+2
| | | | | | | * ext/socket/raddrinfo.c (rsock_inspect_sockaddr): cast down explicitly to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/rubysocket.h (HAVE_TYPE_STRUCT_SOCKADDR_DL):naruse2013-05-111-1/+5
| | | | | | | MSVC has struct sockadddr_dl, but its content is broken. http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130511T103938Z.log.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (rsock_inspect_sockaddr): Add casts toakr2013-05-111-12/+12
| | | | | | | | suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket: New method, Socket.getifaddrs, implemented.akr2013-05-117-32/+740
| | | | | | | | [ruby-core:54777] [Feature #8368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num shouldakr2013-05-091-1/+1
| | | | | | | | not be negative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c, ext/etc/etc.c, ext/socket/unixsocket.c,akr2013-05-091-1/+1
| | | | | | | | | ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (bsock_sendmsg_internal): Always setakr2013-05-091-4/+6
| | | | | | | | | | controls_num to raise NotImplementedError appropriately. (bsock_recvmsg_internal): Raise NotImplementedError if :scm_rights=>true is given on platforms which don't have 4.4BSD style control message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/rubysocket.h, ext/socket/unixsocket.c,akr2013-05-093-22/+22
| | | | | | | | | ext/socket/ancdata.c: Use HAVE_STRUCT_MSGHDR_MSG_CONTROL instead of HAVE_ST_MSG_CONTROL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error message refined.akr2013-05-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly fillednaruse2013-05-071-1/+1
| | | | | | | | | | sin6_scope_id on KAME introduced by r40593 for OpenIndiana. KAME uses fe80:<scope_id>::<interface id> for link-local address internally. Setting sin6_scope_id causes it leaked. see also comments of sockaddr_obj(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (bsock_recvmsg_internal): Add a cast toakr2013-05-071-1/+1
| | | | | | | | | | | suppress warning. Bionic defines socklen_t as int. Bionic defines msg_controllen as unsigned int (__kernel_size_t) instead of socklen_t as POSIX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ancdata.c (ancillary_inspect): Don't callakr2013-05-071-1/+1
| | | | | | | | | anc_inspect_ipv6_pktinfo if !HAVE_TYPE_STRUCT_IN6_PKTINFO. anc_inspect_ipv6_pktinfo is not defined in the case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (socket_s_ip_address_list): Cast EXTRA_SPACE asakr2013-05-071-1/+1
| | | | | | | | int. This suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Set close_fds false for Cygwin.akr2013-05-071-0/+4
| | | | | | | | | Cygwin doesn't support fd passing. This enables socket extension library cross-compilable by default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (socket_s_ip_address_list): Fill sin6_scope_idakr2013-05-061-0/+20
| | | | | | | | | if getifaddrs() returns an IPv6 link local address which sin6_scope_id is zero, such as on OpenIndiana SunOS 5.11. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Make default_ipv6 true for Cygwin.akr2013-05-031-1/+1
| | | | | | | | | Cygwin supports IPv6 since Cygwin 1.7.1 (2009-12). http://cygwin.com/ml/cygwin-announce/2009-12/msg00027.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {getaddrinfo,getnameinfo}.c: fix for old platformsnobu2013-05-032-0/+8
| | | | | | | * ext/socket/{getaddrinfo,getnameinfo}.c: define socklen_t if not defined, e.g., older VC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e