summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2015-05-21digest.c: GC guardnobu
* ext/digest/digest.c (hexencode_str_new, rb_digest_base_update): prevent argument strings from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18nonblock.c: just yield if the flag is not changednobu
* ext/io/nonblock/nonblock.c (io_nonblock_set): return whether nonblock flag was changed. * ext/io/nonblock/nonblock.c (rb_io_nonblock_block): nothing to restore but just yield unless nonblock flag is changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17notimplement: renamenobu
* ext/-test-/notimplement, test/-ext-/test_notimplement.rb: rename from bug-3662. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-17ext/socket/init.c: use SOCK_NONBLOCK if availablenormal
This saves a system call by allowing us to use SOCK_NONBLOCK in Linux when accept4 is available. Note: I do not agree accept_nonblock should always make accepted sockets non-blocking, and will propose a future API to allow controlling whether accepted sockets are non-blocking or not regardless of how they were created. * ext/socket/init.c (cloexec_accept): support nonblock flag and use SOCK_NONBLOCK if possible * ext/socket/init.c (rsock_s_accept_nonblock): update cloexec_accept call * ext/socket/init.c (accept_blocking): ditto for blocking * test/socket/test_nonblock.rb: check nonblock? on accepted socket [Feature #11138] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16ifaddr.c: wrapper object before allocnobu
* ext/socket/ifaddr.c (rsock_getifaddrs): make wrapper object before result structs allocation and manage refcount for each elements to get rid of potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16allocate structs with wrappernobu
* parse.y (rb_parser_new, ripper_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. * variable.c (rb_autoload): ditto. * ext/digest/digest.c (rb_digest_base_alloc): ditto. * ext/strscan/strscan.c (strscan_s_allocate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16gc.c: rename alloc as wrapnobu
* gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename alloc as wrap. these functions do not allocate data pointers but just wrap the given pointers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-14* ext/pathname/lib/pathname.rb: Remove condition of RUBY_VERSION <= 1.9.hsbt
[Feature #11082] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10* ext/zlib/zlib.c (rb_gzreader_external_encoding):glass
define GzipReader#external_encoding. [Bug #10900] * test/zlib/test_zlib.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10* ext/win32ole/win32ole_variant.c: fix typo "indicies".glass
the patch is from davydovanton <antondavydov.o at gmail.com>. [fix GH-892] * lib/rubygems/indexer.rb: ditto. * test/rubygems/test_gem_indexer.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08ext/socket/ancdata.c (bsock_recvmsg_internal): GC guardnormal
The control buffer may be used throughout the function, so prevent the string from being lost to GC. * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard [Bug #11123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08extconf.rb: no nmake style VPATHnobu
* ext/io/console/extconf.rb: only nmake needs remove style VPATH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08depend: no nmake style VPATHnobu
* ext/io/console/depend: remove nmake style VPATH, for normal makes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-07checksum.rb: check the targetnobu
* tool/checksum.rb (Checksum#update?): check if the target exists too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-07win32_vk.inc: renamednobu
* ext/io/console/win32_vk.inc: renamed not to be included in HDRS by mkmf.rb and regenerated unexpectedly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06io/console: win32_vk dependenciesnobu
* ext/io/console/depend: check if VK table is modified by the checksum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-06stdlib: use IO#wait_*able instead of IO.select when possiblenormal
In case a process encounters high-numbered FDs, this allows consistent performance on systems with ppoll support. [ruby-core:35572] * ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable * lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable * lib/webrick/httpserver.rb (run): ditto * lib/resolv.rb (request): ditto for single socket case [ruby-core:68943] [Feature #11081] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-05io/console: vk_header only on Windowsnobu
* ext/io/console/extconf.rb: vk_header is used only on Windows, nonsense to update on other platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: pressed? on Windowsnobu
* ext/io/console/console.c (console_key_pressed_p): new method IO#pressed? on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: cursor position on Windowsnobu
* ext/io/console/console.c (console_goto): new method IO#goto on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_pos): new method IO#cursor on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_set): new method IO#cursor= on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: IO#beepnobu
* ext/io/console/console.c (console_beep): new method IO#beep. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03* ext/-test-/file/fs.c: need to include sys/statvfs.hodaira
to use statvfs(). * ext/-test-/file/extconf.rb: check the existence of sys/statvfs.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: remove old ifdefnobu
* ext/io/console/console.c (LAST_ERROR): remove old ifdef, should use rb_w32_map_errno always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30ipsocket.c: fix merge missnobu
* ext/socket/ipsocket.c (init_inetsock_internal): fix local variable name by merge miss. [ruby-core:68531] [Bug #10975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-30ipsocket.c: sys_errornobu
* ext/socket/ipsocket.c (init_inetsock_internal): preserve errno before other library calls and use rb_syserr_fail. [ruby-core:68531] [Bug #10975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20socket: avoid common exceptions when calling connect_nonblocknormal
Errno::EISCONN and IO::WaitReadable exceptions are common, expensive, and noisy under normal use. Avoid raising on them since they are not exceptional. * ext/socket/lib/socket.rb (connect_internal): avoid common exceptions from connect_nonblock. [ruby-core:68909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20* ext/openssl/*: use license instead of licence.hsbt
[fix GH-876][ci skip] Patch by @davydovanton * lib/net/https.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20connect_nonblock(..., exception: false) does not raise EISCONNnormal
* ext/socket/socket.c (sock_connect_nonblock): do not raise EISCONN [ruby-core:68926] [Feature #11072] * test/socket/test_nonblock.rb: check non-EISCONN on 2nd connect This is to reduce exceptions for code which issues a (IMHO, unnecessary) second connect() syscall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-19ext: suppress warningsnobu
* ext/{etc,openssl,tk}: Adding parens and comparisons around assignments to get rid of Wparentheses warnings. [Fix GH-875] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18parser.rl: define enc_raise iff necessarynobu
* ext/json/parser/parser.rl (enc_raise): no needs if rb_enc_raise is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18parser.rl: rb_enc_raisenobu
* ext/json/parser/parser.rl: raise with messages in UTF-8 encoding. [ruby-core:67386] [Bug #10705] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18parser.rl: use rb_encodingnobu
* ext/json/parser/parser.rl (convert_encoding): use rb_encoding functions to compare and convert encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18parser.rl: use StringValuenobu
* ext/json/parser/parser.rl (cParser_initialize): use StringValue instead of direct rb_convert_type and remove duplicate conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-17tkutil.c: revert r48250nobu
* ext/tk/tkutil/tkutil.c (Init_tkutil): TkUtil::CallbackSubst and TkUtil::CallbackSubst::Info need the default allocator. [ruby-list:50115] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-17nofree.c: Bug::String.nofreenobu
* ext/-test-/string/nofree.c: new method for test of r50334. [ruby-core:68436] [Bug #10942] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-15* doc/contributors.rdoc: fix a typo. Patch by @davydovantonhsbt
[fix GH-872][ci skip] * doc/syntax/methods.rdoc: ditto. * ext/digest/sha2/sha2.c: ditto. * ext/socket/ipsocket.c: ditto. * ext/tk/*: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14win32ole.c: use rb_sym2strnobu
* ext/win32ole/win32ole.c: use rb_sym2str when the result strings will not be modified. * ext/win32ole/win32ole_event.c: ditto. * ext/win32ole/win32ole_record.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14tkutil.c: fallback rb_id2strnobu
* ext/tk/tkutil/tkutil.c (rb_id2str): add fallback definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14tkutil.c: use rb_sym2strnobu
* ext/tk/tkutil/tkutil.c (rb_sym2str): use rb_sym2str always but not rb_sym_to_s, and fallback to rb_id2str and SYM2ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14use frozen string of symbolsnobu
* range.c (range_step, range_each): String#upto should never modifies the receiver, use frozen strings to enumerate symbols. * re.c (reg_operand): matching target is not modified. * ext/socket/constants.c (constant_arg): str_to_int never modifies argument strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14printf.c: uint_to_strnobu
* ext/-test-/printf/printf.c (uint_to_str): renamed to get rid of conflict on cygwin. [ruby-core:68877] [Bug #11065] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-13* ext/openssl/lib/openssl/ssl.rb: stricter hostname verificationnagachika
following RFC 6125. with the patch provided by Tony Arcieri and Hiroshi Nakamura [ruby-core:61545] [Bug #9644] * test/openssl/test_ssl.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12* ext/json/json.gemspec: bump version to 1.8.2.hsbt
* ext/json/lib/json/version.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12* ext/json/json.gemspec, lib/rdoc/rdoc.gemspec: added gemspec directly.hsbt
* defs/default_gems, tool/rbinstall.rb: removed default_gems definition. it make simple installation for default gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12* ext/json/*, test/json/*: Reverted r50231. Because it's not works withhsbt
cross-compile environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12wait.c: no EOFnobu
* ext/io/wait/wait.c (io_wait_readable): simply returns that IO is readable without blocking, but no longer returns EOF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12wait.c: poll over nreadnobu
* ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling first and check FIONREAD optionally to see if EOF. [ruby-core:36805] [Feature #4849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12wait.c: fix rdocnobu
* ext/io/wait/wait.c (io_wait_writable): fix rdoc. no EOF to write. retursn nil when timeout, not self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12* ext/coverage/coverage.c: Remove extension from require argument.hsbt
[ci skip][fix GH-870] Patch by @yui-knk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12connect_nonblock supports "exception: false"normal
This is for consistency with accept_nonblock arguments and gives a minor speedup from avoiding exceptions. [ruby-core:68838] [Feature #11024] * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): support `exception: false' * (get_no_exception): move function location * ext/socket/socket.c (sock_connect_nonblock): support `exception: false' * test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception): test `exception: false' on connect, rename from `test_accept_nonblock_no_exception' * test/socket/test_nonblock.rb (test_connect_nonblock_no_exception): new test Benchmark results: default 0.050000 0.100000 0.150000 ( 0.151307) exception: false 0.030000 0.080000 0.110000 ( 0.108840) ----------------------------8<----------------------- require 'socket' require 'benchmark' require 'io/wait' require 'tmpdir' host = '127.0.0.1' serv = TCPServer.new(host, 0) # UNIX sockets may not hit EINPROGRESS nr = 5000 # few iterations to avoid running out of ports addr = serv.getsockname pid = fork do begin serv.accept.close rescue => e warn "#$$: #{e.message} (#{e.class})" end while true end at_exit { Process.kill(:TERM, pid) } serv.close Benchmark.bmbm do |x| x.report("default") do nr.times do s = Socket.new(:INET, :STREAM) s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1) begin s.connect_nonblock(addr) rescue IO::WaitWritable s.wait_writable end s.close end end x.report("exception: false") do nr.times do s = Socket.new(:INET, :STREAM) s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1) case s.connect_nonblock(addr, exception: false) when :wait_writable s.wait_writable end s.close end end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e