akr
dd1c3a7509
* ext/socket: Wrap struct addrinfo by struct rb_addrinfo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19 09:38:24 +00:00
akr
948ce9decb
* ext/socket/ipsocket.c (ip_s_getaddress): Don't access freed memory.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19 08:51:33 +00:00
akr
6f8b0e9bb0
* include/ruby/intern.h,
...
include/ruby/io.h,
include/ruby/ruby.h,
include/ruby/win32.h,
include/ruby/backward/rubysig.h,
bignum.c,
gc.c,
io.c,
process.c,
safe.c,
struct.c,
thread.c,
ext/socket/rubysocket.h,
ext/-test-/old_thread_select: Remove deprecated definitions
[ruby-core:60581] [Feature #9502 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14 15:16:31 +00:00
normal
cb07275001
socket: split out SOCK_CLOEXEC versions of wrappers for readability
...
* ext/socket/init.c (rsock_socket0): split out SOCK_CLOEXEC version
* ext/socket/socket.c (rsock_socketpair0): ditto
[ruby-core:60377]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31 08:06:19 +00:00
nobu
d0a84c2ce9
socket.c: suppress warnings
...
* ext/socket/init.c (rsock_socket0): suppress unused label
warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31 07:08:52 +00:00
nobu
0cee7f8e2f
socket.c: suppress warnings
...
* ext/socket/socket.c (rsock_socketpair0): suppress unused label
warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-29 02:04:16 +00:00
akr
965b947fff
* ext/socket: Avoid redundant fcntl/fstat syscalls for cloexec
...
sockets.
Patch by Eric Wong. [ruby-core:59429] [Feature #9330 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 14:37:34 +00:00
akr
3ffc7535ba
Several more OS information for TYPE_IP_MULTICAST_LOOP and
...
TYPE_IP_MULTICAST_TTL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-21 13:39:08 +00:00
nobu
6cfa67afe7
ext/socket/option.c: fix typo
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 22:52:17 +00:00
akr
8b5694d5e8
* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
...
IP_MULTICAST_TTL on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 19:35:11 +00:00
akr
779a630aee
* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
...
IP_MULTICAST_TTL on Mac OS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 19:32:03 +00:00
akr
3682c6a327
* ext/socket/option.c: Use "byte" as default argument for
...
IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
the original multicast implementation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 15:43:47 +00:00
akr
3b8bcf42a7
* ext/socket/option.c: Use preprocessor macros to avoid repeated
...
conditionals.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-20 13:48:42 +00:00
nobu
5ecbe189af
socket/option.c: helper functions
...
* ext/socket/option.c (sockopt_pack_byte, sockopt_pack_int):
extract helper functions to pack integers in a String.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 14:56:05 +00:00
nobu
5c179cd66c
socket/option.c: revert r44647
...
* ext/socket/option.c (NUM2SOCKOPT, sockopt_value): revert because
these names are confusing. [ruby-dev:47903]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 13:04:53 +00:00
hsbt
d1ab866d4a
* ext/nkf/nkf-utf8/nkf.c: fix typo by @windwiny [fix GH-506]
...
* ext/openssl/ossl_ssl.c: ditto
* ext/psych/yaml/scanner.c: ditto
* ext/socket/init.c: ditto
* ext/socket/socket.c: ditto
* ext/tk/tcltklib.c: ditto
* ext/win32ole/win32ole.c: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:43:23 +00:00
nobu
6282b3b5c3
socket/option.c: socket option variations
...
* ext/socket/option.c (NUM2SOCKOPT, sockopt_value): extract to wrap
socket option variations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 01:11:01 +00:00
akr
971ef82267
* ext/socket: Avoid unnecessary ppoll/select on Linux.
...
Patch by Eric Wong. [ruby-core:57950] [Bug #9039 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 14:13:22 +00:00
akr
7efaa4f5d0
[DOC]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 12:44:36 +00:00
akr
57b2190d55
* ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
...
option takes a byte on OpenBSD.
Fixed by Jeremy Evans. [ruby-core:59496] [Bug #9350 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-18 12:31:57 +00:00
nobu
5b0fb1aadd
socket.c: format flags
...
* ext/socket/socket.c (rsock_syserr_fail_host_port): use format flags,
'+' to inspect, ' ' to quote unprintables.
* ext/socket/socket.c (rsock_syserr_fail_path): ditto.
* ext/socket/socket.c (rsock_syserr_fail_raddrinfo): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-04 10:15:31 +00:00
nobu
a3f2fe4e4d
socket.c: use rb_syserr_fail
...
* ext/socket/socket.c (rsock_syserr_fail_host_port): add errno
argument version anduse rb_syserr_fail_str() instead of
rb_sys_fail_str() with restoring errno.
* ext/socket/socket.c (rsock_syserr_fail_path): ditto, and
rb_syserr_fail().
* ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto, use
rsock_syserr_fail_raddrinfo().
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto.
* ext/socket/socket.c (setup_domain_and_type): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-04 10:13:36 +00:00
charliesome
8f04556111
* ext/socket/socket.c (rsock_sys_fail_host_port): save and restore errno
...
before calling rb_sys_fail_str to prevent [BUG] errno == 0.
Patch by Eric Wong. [ruby-core:59498] [Bug #9352 ]
* ext/socket/socket.c (rsock_sys_fail_path): ditto
* ext/socket/socket.c (rsock_sys_fail_sockaddr): ditto
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): ditto
* ext/socket/socket.c (rsock_sys_fail_raddrinfo_or_sockaddr): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-03 10:12:38 +00:00
akr
4fd53e476e
* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause because
...
it may be set before the body.
Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247 ]
* lib/cgi/core.rb: Ditto.
* lib/drb/ssl.rb: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13 16:11:12 +00:00
mame
a6ae6a8b17
* ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.
...
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
2013-10-02 12:41:28 +00:00
glass
0e7c28a1c3
* ext/socket/mkconstants.rb: define MSG_FASTOPEN.
...
[ruby-core:57138] [Feature #8897 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-15 15:48:38 +00:00
akr
888e5cbbe7
* process.c: Remove spaces between SI prefix and unit to follow
...
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
2013-09-09 12:33:36 +00:00
akr
dd946739dd
* ext/socket/mkconstants.rb (TCP_FASTOPEN): Defined for TCP fast open.
...
[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
2013-09-07 01:41:47 +00:00
zzak
77ca81e465
* ext/socket/unixserver.c: [DOC] Document #accept
...
* 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
2013-08-19 16:54:59 +00:00
akr
8c55a0a6e4
* ext/socket/ipsocket.c (init_inetsock_internal): Don't try mismached
...
address family if already failed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01 15:43:21 +00:00
akr
b7fd00c8fa
* ext/socket/ipsocket.c (init_inetsock_internal): Use an address
...
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
2013-07-01 11:05:47 +00:00
akr
a5fcce2820
* ext/socket/ipsocket.c (init_inetsock_internal): Don't use local
...
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
2013-06-28 03:16:07 +00:00
drbrain
d341276561
* ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X
...
10.7+. [ruby-trunk - Bug #8517 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 20:32:42 +00:00
shugo
1f828497d1
* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
...
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
2013-06-12 14:20:51 +00:00
kou
e214b1b6d3
* ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:51:48 +00:00
kou
f6921a3cd1
* ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing return
...
value assignment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:50:45 +00:00
naruse
52a802a428
* ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
...
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
2013-06-10 11:59:36 +00:00
naruse
e2582ca28d
* ext/socket/option.c: rename functions introduced in r41009
...
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
2013-06-02 14:24:34 +00:00
nobu
488f478d24
* ext/socket/option.c (inspect_byte): used only on NetBSD.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 22:53:58 +00:00
naruse
a78e45b5fe
* ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
...
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
2013-05-31 17:37:55 +00:00
akr
9cc1cc2045
* ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 11:28:51 +00:00
akr
bfec5ad41f
* ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 08:17:03 +00:00
akr
2c7c4b2e7b
* ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:
...
comparison between signed and unsigned integer expressions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 07:58:36 +00:00
akr
94dfc14ed8
* ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 00:01:10 +00:00
akr
a7acc99193
* ext/socket/mkconstants.rb: Convert integer constants bigger than int
...
correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 15:39:59 +00:00
akr
9d099423e7
* ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flags
...
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
2013-05-17 13:04:17 +00:00
akr
d05010f6a4
Enable the document for Socket::Ifaddr#ifindex.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-17 03:11:42 +00:00
akr
8416b57943
Fix a dependency.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-16 10:29:05 +00:00
akr
a84c2941c2
* ext/socket/depend: Add a dependency for ifaddr.o.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-15 17:04:03 +00:00
akr
1e5a64261f
* ext/socket/.document: Add ifaddr.c.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-14 14:48:00 +00:00