Граф коммитов

975 Коммитов

Автор SHA1 Сообщение Дата
nobu 0bc5341690 option.c: single byte boolean
* ext/socket/option.c (sockopt_bool): relax boolean size to be one
  too not only sizeof(int).  Winsock getsockopt() returns a single
  byte as a boolean socket option.  [ruby-core:72730] [Bug #11958]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 06:31:36 +00:00
nobu b25ad0daaa option.c: make error messages consistent
* ext/socket/option.c (check_size): extract a macro to check
  binary data size, with a consistent message.
* ext/socket/option.c (sockopt_byte): fix error message,
  sizeof(int) differs from sizeof(unsigned char) in general.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-17 05:41:01 +00:00
nobu f9adadc5e6 rb_readwrite_syserr_fail
* io.c (rb_readwrite_syserr_fail): works with the given errno than
  thread local errno.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 14:58:47 +00:00
nobu f4166e2dd7 prefer rb_syserr_fail
* file.c, io.c, util.c: prefer rb_syserr_fail with saved errno
  over setting errno then call rb_sys_fail, not to be clobbered
  potentially and to reduce thread local errno accesses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 08:57:48 +00:00
normal 1abef5bd11 ext/socket/init.c (rsock_init_sock): reject reserved FDs
[ruby-core:72445] [Bug #11862]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22 22:28:31 +00:00
naruse 4eac2e833c fix r53231: raise Errno::EBADF like other OSes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22 13:45:14 +00:00
normal 409e53dec1 avoid rb_bug on BasicSocket.for_fd(-1)
* ext/socket/init.c (rsock_init_sock): check FD after validating
* test/socket/test_basicsocket.rb (test_for_fd): new
  [ruby-core:72418] [Bug #11854]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-21 18:57:50 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt 059c9c1cf3 * ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* lib/drb/extservm.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/http/response.rb: ditto.
* lib/scanf.rb: ditto.
* lib/uri/generic.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 08:05:35 +00:00
normal 10735e2d03 ext/socket/ifaddr.c: remove empty ifaddr_mark
We do not need to maintain empty functions for GC,
gc_mark_children will not attempt to dereference NULL
dmark callbacks.

* ext/socket/ifaddr.c (ifaddr_mark): remove empty function
  (ifaddr_type): pass zero to rb_data_type_t.function.dmark

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 20:07:23 +00:00
ko1 dff42b0ea0 * ext/**/*.c (*_memsize): same as r52986 for extensions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-09 01:01:17 +00:00
normal 889f50227c socket: expand docs+tests for recv_io/send_io
* ext/socket/unixsocket.c (unix_send_io): document args
  (unix_recv_io): ditto
* test/socket/test_unix.rb (test_fd_passing_class_mode): added

I was working on these when I encountered the problem in
with BasicSocket.for_fd not handling mode args:
https://bugs.ruby-lang.org/issues/11778

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:39:47 +00:00
nobu 13a935b0ba Drop support for BeOS
* beos: Drop support for BeOS now that Haiku is stable.
  [Fix GH-1112]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24 00:17:11 +00:00
normal d51743afc8 ext/socket/init.c (rsock_accept): handle ENOMEM
accept(2) documents ENOMEM as a possible error, handle it
consistent with all of our other FD-allocating wrappers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 22:57:29 +00:00
normal 61e5fe0674 use rb_gc_for_fd for more callers
* dir.c (dir_initialize): use rb_gc_for_fd for ENOMEM
* ext/socket/init.c (rsock_socket): ditto
* ext/socket/socket.c (rsock_socketpair): ditto
* internal.h (rb_gc_for_fd): prototype
* io.c (rb_gc_for_fd): remove static
  [ruby-core:71623] [Feature #11727]

Manpages for opendir(2), socket(2), and socketpair(3posix)
describe ENOMEM as a possible error for each of these;
handle it consistently with our existing wrappers for
open(2)/pipe(2) etc...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 22:50:53 +00:00
nobu e29c109d2a Haiku now best effort support
* configure.in: remove obsolete workarounds for Haiku.
* dln.c, file.c, io.c: remove obsolete Haiku workarounds.
* thread_pthread.c: add stack bounds detection for Haiku.
* signal.c: get stack pointer from signal context on Haiku.
  [ruby-core:67923] [Bug #10811] [Fix GH-1109]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 03:54:42 +00:00
hsbt 35c3f042fc * ext/socket/socket.c: remove mention of :UNIX in getaddrinfo().
It's typically not a support option.
  [ci skip][fix GH-990] Patch by @eam

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-20 03:48:10 +00:00
akr 33b832979b * ext/socket/ancdata.c: Check buffer full and ignore MSG_TRUNC flag.
buffer fullness is more robust to detect the message is too big for
  the buffer.
  AIX 7.1 recvmsg doesn't set MSG_TRUNC for rflags when MSG_PEEK is
  given.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-19 13:49:58 +00:00
usa 3006e5ea78 * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
only when vmaxdatlen is nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18 17:53:20 +00:00
usa d8e1939232 * ext/socket/ancdata.c (bsock_recvmsg_internal): stretch the buffer size
when EMSGSIZE occurs on non HAVE_STRUCT_MSGHDR_MSG_CONTROL platforms
  (such as, Windows).  fixes a test error revealed by r52625.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18 01:37:34 +00:00
normal ca5f5871e8 socket: fix typo for default size
* ext/socket/ancdata.c (bsock_recvmsg_internal): use 4096 as
  default size to match pre-r52610, which also maps to a common
  page size.

Oops; absolutely no idea why I made this typo...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18 01:18:30 +00:00
normal 508b5fdd52 socket: fix recvmsg without argument
* ext/socket/ancdata.c (bsock_recvmsg_internal): grow buffer
  on unspecified maxdatlen
  [ruby-core:71517] [Bug #11701]
* ext/socket/lib/socket.rb (Socket#recvmsg): nil default for dlen
  (Socket#recvmsg_nonblock): ditto
* test/socket/test_socket.rb (test_recvmsg_udp_no_arg): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 22:00:23 +00:00
usa 66e2139b1a * ext/socket/lib/socket.rb (Socket#recvmsg{,_nonblock}): default values
of clen must be nil.

* ext/socket/ancdata.c (bsock_sendmsg_internal): handle nil of clen.
  fixes test errors introduced at r52602.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 05:06:18 +00:00
usa 4b9cd6edce * ext/socket/lib/socket.rb: UNIXSocket is not always exists. fixes
install error on Windows, introduced at r52601.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 04:55:36 +00:00
normal 55a692bbc2 socket: update doc for recvfrom_nonblock [ci skip]
* ext/socket/lib/socket.rb (Socket#recvfrom_nonblock):
  UDPSocket#recvfrom_nonblock):
  update doc for `exception: false` and destination buffer
  [ruby-core:69542] [Feature #11229]
  [ruby-core:69543] [Feature #11242]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 02:29:19 +00:00
nobu afe142997b init.c: is_socket
* ext/socket/init.c (is_socket): extract predicate to see if the
  given fd is a socket.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 02:15:55 +00:00
normal 8478b30267 socket: avoid exceptions in wrapper code
* ext/socket/lib/socket.rb (Socket.accept_loop): avoid exceptions
  (Socket.udp_server_recv): ditto

Exceptions for common "errors" make debug output noisy and
allocations+backtrace generation hurt performance.
[ruby-core:66385] [ruby-core:69473]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 01:16:25 +00:00
normal eda2441b53 socket: avoid arg parsing in bsock_sendmsg_internal
* ext/socket/ancdata.c (bsock_sendmsg_internal): avoid arg parsing
  [ruby-core:71439] [Feature #11339]
  (rsock_bsock_sendmsg): make private, adjust for above
  (rsock_bsock_sendmsg_nonblock): ditto
* ext/socket/rubysocket.h: adjust prototypes
  (rsock_opt_false_p): remove
* ext/socket/basicsocket.c (rsock_init_basicsocket):
  define private methods
* ext/socket/lib/socket.rb (BasicSocket#sendmsg): new wrapper
  (BasicSocket#sendmsg_nonblock): ditto

target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52550) [x86_64-linux]

-----------------------------------------------------------
sendmsg_nonblock

require 'socket'
nr = 1_000_000
i = 0
msg = '.'
buf = '.'
begin
  r, w = UNIXSocket.pair(:SEQPACKET)
  while i < nr
    i += 1
    w.sendmsg_nonblock(msg, exception: false)
    r.recv(1, 0, buf)
  end
ensure
  r.close
  w.close
end

-----------------------------------------------------------
raw data:

[["sendmsg_nonblock",
  [[1.875997293740511,
    1.8452614955604076,
    1.8449317328631878,
    1.8418389447033405,
    1.869386937469244],
   [1.5175109766423702,
    1.4987873211503029,
    1.4989623799920082,
    1.47918451577425,
    1.5017359890043736]]]]

Elapsed time: 16.775453245 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name             a       b
sendmsg_nonblock   1.842   1.479

Speedup ratio: compare with the result of `a' (greater is better)
name             b
sendmsg_nonblock   1.245

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 01:05:30 +00:00
normal 416c50f574 socket (bsock_recvmsg_internal): avoid arg parsing
* ext/socket/ancdata.c (bsock_recvmsg_internal): avoid arg parsing
  (rsock_bsock_recvmsg): adjust for above change
  (rsock_bsock_recvmsg_nonblock): ditto
  [ruby-core:71439] [Feature #11339]
* ext/socket/rubysocket.h: adjust prototypes for above
* ext/socket/basicsocket.c (rsock_init_basicsocket):
  adjust private methods
* ext/socket/lib/socket.rb (BasicSocket#recvmsg): wrapper method
  (BasicSocket#recvmsg_nonblock): ditto

target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52550) [x86_64-linux]

-----------------------------------------------------------
recvmsg_nonblock

require 'socket'
nr = 1_000_000
i = 0
msg = '.'
buf = '.'
begin
  r, w = UNIXSocket.pair(:SEQPACKET)
  while i < nr
    i += 1
    w.sendmsg(msg)
    r.recvmsg_nonblock(1, exception: false)
  end
ensure
  r.close
  w.close
end

-----------------------------------------------------------
raw data:

[["recvmsg_nonblock",
  [[3.721687912940979,
    3.6072621569037437,
    3.580637402832508,
    3.614185404032469,
    3.6029579415917397],
   [2.4694008752703667,
    2.4908322244882584,
    2.5051278844475746,
    2.5037173740565777,
    2.548359278589487]]]]

Elapsed time: 30.646087052 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name             a       b
recvmsg_nonblock   3.581   2.469

Speedup ratio: compare with the result of `a' (greater is better)
name             b
recvmsg_nonblock   1.450

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17 00:58:23 +00:00
normal bee5b49aec socket: avoid arg parsing in rsock_s_accept_nonblock
* ext/socket/init.c (rsock_s_accept_nonblock): avoid parsing args
  [ruby-core:71439] [Feature #11339]
* ext/socket/rubysocket.h: adjust prototype
* ext/socket/socket.c (sock_accept_nonblock): make private
* ext/socket/tcpserver.c (tcp_accept_nonblock): ditto
* ext/socket/unixserver.c (unix_accept_nonblock): ditto
* ext/socket/lib/socket.rb (Socket#accept_nonblock):
  implement as wrapper, move RDoc
  (TCPServer#accept_nonblock): ditto
  (UNIXServer#accept_nonblock): ditto

target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52550) [x86_64-linux]

-----------------------------------------------------------
accept_nonblock

require 'tempfile'
require 'socket'
require 'io/wait'
nr = 500000
Tempfile.create(%w(accept_nonblock .sock)) do |tmp|
  path = tmp.path
  File.unlink(path)
  s = UNIXServer.new(path)
  addr = Socket.sockaddr_un(path).freeze
  nr.times do
    s.accept_nonblock(exception: false)
    c = UNIXSocket.new(path)
    s.wait_readable
    s.accept_nonblock(exception: false).close
    c.close
  end
end

-----------------------------------------------------------
raw data:

[["accept_nonblock",
  [[4.807877402752638,
    4.930681671947241,
    4.738454818725586,
    4.69268161803484,
    4.684675686061382],
   [4.253904823213816,
    4.255124930292368,
    4.295955188572407,
    4.248479191213846,
    4.213303029537201]]]]

Elapsed time: 45.123040065 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name            a       b
accept_nonblock   4.685   4.213

Speedup ratio: compare with the result of `a' (greater is better)
name            b
accept_nonblock   1.112

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16 23:40:15 +00:00
normal bb6dfab2a8 socket: Socket#connect_nonblock avoids arg parsing with C API
* ext/socket/socket.c (sock_connect_nonblock):
  avoid argument parsing in C.
  [ruby-core:71439] [Feature #11339]
* ext/socket/lib/socket.rb (Socket#connect_nonblock):
  new wrapper for private method, move RDoc

target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52540) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52540) [x86_64-linux]

-----------------------------------------------------------
connect_nonblock

require 'tempfile'
require 'socket'
require 'io/wait'
nr = 500000
Tempfile.create(%w(connect_nonblock .sock)) do |tmp|
  path = tmp.path
  File.unlink(path)
  s = UNIXServer.new(path)
  addr = Socket.sockaddr_un(path).freeze
  nr.times do
    c = Socket.new(Socket::AF_UNIX, Socket::SOCK_STREAM)
    while c.connect_nonblock(addr, exception: false) == :wait_writable
      c.wait_writable
    end
    s.accept.close
    c.close
  end
end

-----------------------------------------------------------
raw data:

[["connect_nonblock",
  [[4.014209181070328,
    3.8479955345392227,
    3.981342639774084,
    4.471840236335993,
    3.7867715656757355],
   [3.639054525643587,
    3.58337214961648,
    3.525284394621849,
    3.52646067738533,
    3.511393066495657]]]]

Elapsed time: 37.889623996 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name             a       b
connect_nonblock   3.787   3.511

Speedup ratio: compare with the result of `a' (greater is better)
name             b
connect_nonblock   1.078

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16 23:34:37 +00:00
normal 528ff1b9f9 socket: avoid arg parsing in rsock_s_recvfrom_nonblock
* ext/socket/init.c (rsock_s_recvfrom_nonblock):
  avoid arg parsing with C API
  [ruby-core:71439] [Feature #11339]
* ext/socket/basicsocket.c (bsock_recv_nonblock):
  adjust for above change, make private
* ext/socket/socket.c (sock_recvfrom_nonblock): ditto
* ext/socket/udpsocket.c (udp_recvfrom_nonblock): ditto
* ext/socket/lib/socket.rb (BasicSocket#recv_nonblock):
  new wrapper for private method, move RDoc
  (Socket#recvfrom_nonblock): ditto
  (UDPSocket#recvfrom_nonblock): ditto

Note, not adding bm_recv_nonblock.rb to benchmark/ directory
since it is non-portable.  It is only in this commit message.

Benchmark results + code
target 0: a (ruby 2.3.0dev (2015-11-12 trunk 52540) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-12 avoid-kwarg-capi 52540) [x86_64-linux]

-----------------------------------------------------------
recv_nonblock

require 'socket'
nr = 1000000
msg = 'hello world'
buf = ''
size = msg.bytesize
UNIXSocket.pair(:SEQPACKET) do |a, b|
  nr.times do
    a.sendmsg(msg)
    b.recv_nonblock(size, 0, buf, exception: false)
  end
end

-----------------------------------------------------------
raw data:

[["recv_nonblock",
  [[1.83511221408844,
    1.8703329525887966,
    1.8448856547474861,
    1.859263762831688,
    1.8331583738327026],
   [1.5637447573244572,
    1.4062932096421719,
    1.4247371144592762,
    1.4108827747404575,
    1.4802536629140377]]]]

Elapsed time: 16.530452496 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name          a       b
recv_nonblock   1.833   1.406

Speedup ratio: compare with the result of `a' (greater is better)
name          b
recv_nonblock   1.304

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-16 23:25:03 +00:00
akr 373e87a74d * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-14 13:15:33 +00:00
nobu 612978edbc ext: use RARRAY_ASET
* ext/socket/socket.c (make_addrinfo): use RARRAY_ASET for
  write-barrier.
* ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): ditto.
* ext/tk/tkutil/tkutil.c (ary2list, ary2list2): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-05 01:17:19 +00:00
nobu 57e2877e7b ext: use RARRAY_AREF
* ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
  pointed out by hanmac.
  https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-05 01:09:17 +00:00
nobu 3553a86eb5 ext: use RARRAY_CONST_PTR
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore
  reference instead of RARRAY_PTR, to keep the array WB-protected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04 07:27:10 +00:00
hsbt 5d5315ad3b * configure.in: fixed build failure of Haiku.
[fix GH-984] Patch by @kallisti5
* ext/socket/getaddrinfo.c: ditto.
* ext/socket/getnameinfo.c: ditto.
* ext/socket/rubysocket.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-24 13:51:25 +00:00
nobu 9949407fd9 suppress a warning
* ext/socket/raddrinfo.c (rsock_fd_family): suppress a
  sign-compare warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-19 16:28:56 +00:00
nobu 7594a99322 init.c: glibc bug
* ext/socket/init.c (rsock_raise_socket_error): get rid of a glibc
  bug.  [ruby-core:71100] [Bug #11600]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-19 01:33:49 +00:00
kosaki 4ad2057f27 * ChangeLog: Good-bye OS/2.
* common.mk: ditto.
* configure.in: ditto.
* dln_find.c: ditto.
* ext/Setup.emx: ditto.
* ext/extmk.rb: ditto.
* ext/socket/extconf.rb: ditto.
* ext/zlib/extconf.rb: ditto.
* file.c: ditto.
* include/ruby/defines.h: ditto.
* io.c: ditto.
* lib/mkmf.rb: ditto.
* missing/os2.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* NEWS: announce OS/2 is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 01:18:34 +00:00
akr e794fa5cb5 * ext/socket/raddrinfo.c (rsock_fd_family): Check sa_len.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-13 13:49:58 +00:00
nobu 61053459cf rsock_addrinfo: specify address family
* ext/socket/rsock_addrinfo (rsock_addrinfo): specify address
  family.  [Fix GH-1052]
* ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send):
  address family by the receiver.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-13 03:14:13 +00:00
nobu 324d7c8995 udpsocket.c: free addrinfo
* ext/socket/udpsocket.c (udp_send): ensure addrinfo gets freed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-12 00:11:54 +00:00
nobu 3cf04aceec udpsocket.c: check once first
* ext/socket/udpsocket.c (udp_connect, udp_bind): check if the
  socket is opened once before retreiving address infos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-12 00:11:37 +00:00
nobu d9ac64fdc7 udpsocket.c: refix r52097
* ext/socket/udpsocket.c (udp_connect, udp_bind): get open files
  inside ensure functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-10 10:04:44 +00:00
nobu 38e6235235 udpsocket.c: memory leaks
* ext/socket/udpsocket.c (udp_connect, udp_bind, udp_send): fix
  memory leaks at closed socket.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09 23:52:23 +00:00
nobu b5a5cd605b use rb_sym2str
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): use
  rb_sym2str to get rid of inadvertent ID creations.

* ext/socket/ancdata.c (ancillary_inspect): ditto.

* ext/socket/option.c (sockopt_inspect): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15 04:32:15 +00:00
nobu 7918dc352f socket.c: suppress warnings
* ext/socket/socket.c (socket_s_ip_address_list): suppress
  warnings to assign pointers to literal strings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-05 06:32:04 +00:00
nobu 6f869a57fe ruby/win32.h: include windows.h
* include/ruby/win32.h: include windows.h before winsock2.h,
  because mswsock.h included by the former uses SOCKET defined
  after it in the latter.  fix a build failure with VC6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21 10:51:14 +00:00
sorah 3876d75585 * ext/socket/basicsocket.c: [DOC] typo (Errno::AGAIN -> Errno::EAGAIN)
* ext/socket/socket.c: ditto

* ext/socket/tcpserver.c: ditto

* ext/socket/udpsocket.c: ditto

* ext/socket/unixserver.c: ditto

* io.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-12 00:21:32 +00:00