summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2017-10-27socket: fix BasicSocket#*_nonblock buffering bugs from r58400normal
IO#read_nonblock and IO#write_nonblock take into account buffered data, so the Linux-only BasicSocket#read_nonblock and BasicSocket#write_nonblock methods must, too. This bug was only introduced in r58400 ("socket: avoid fcntl for read/write_nonblock on Linux") and does not affect any stable release. * ext/socket/basicsocket.c (rsock_init_basicsocket): * ext/socket/init.c (rsock_s_recvfrom_nonblock): * ext/socket/init.c (rsock_init_socket_init): * ext/socket/lib/socket.rb (def read_nonblock): * ext/socket/lib/socket.rb (def write_nonblock): * ext/socket/rubysocket.h (static inline void rsock_maybe_wait_fd): * test/socket/test_basicsocket.rb (def test_read_write_nonblock): [Feature #13362] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24sysconfdir on Windowsnobu
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on Windows. [ruby-core:43110] [Bug #6121] * ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set in RbConfig::CONFIG and not empty. * win32/Makefile.sub (config.status): sysconfdir is not used on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24Revert "sysconfdir on Windows"naruse
This reverts commit r60279. This breaks mswin build: https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24Removed NODE_OPT_Nnobu
* node.h (NODE_OPT_N): removed. * parse.y (parser_append_options): expand -n option loop to while gets loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23multiple arguments to writenobu
Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23zlib.c: multiple arguments to writenobu
* ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23stringio.c: write multiple argumentsnobu
* ext/stringio/stringio.c (strio_write_m): make StringIO#write accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add column numbers to branch coverageyui-knk
* compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add column to arguments. * compile.c (compile_if, compile_case, compile_when, compile_loop, iseq_compile_each0): Pass column numbers to macros. * ext/coverage/coverage.c (branch_coverage): Add column numbers to a return value. * test/coverage/test_coverage.rb: Follow-up these changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Fixed misspelling words.hsbt
These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Fix a typo [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22gdbm, dbm, sdbm: remove unnecessary conditionsrhe
The dfree and dsize callback functions are never called with NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22gdbm, dbm, sdbm: prevent memory leak in #initializerhe
Have the allocator function allocate struct dbmdata too. #initialize should not call ALLOC() after opening a file since it can fail with NoMemoryError, leaking the opened file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add missing `buf` parameter to `recv_nonblock` doc [ci skip]nobu
[Fix GH-1725] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22objspace.c: missing typesnobu
* ext/objspace/objspace.c (count_nodes): added recently added node types that were missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22remove NODE_DREGX_ONCEnobu
* node.h (enum node_type): remove NODE_DREGX_ONCE which is not used anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_BMETHODyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r24128. * node.c (dump_node): ditto * node.h (node_type, NEW_BMETHOD): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_BLOCK_ARGyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r11840. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_BLOCK_ARG): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Remove not used node_type NODE_TO_ARYyui-knk
* ext/objspace/objspace.c (count_nodes): This node_type has not been used since r13236. * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_TO_ARY): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21ext/win32ole/win32ole.c (fole_missing): set receiver in NoMethodError.suke
test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21reference Socket.getaddrinfo to Addrinfo.getaddrinfo.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21deprecate TCPSocket.gethostbyname.akr
TCPSocket.gethostbyname has problems similar to Socket.gethostbyname. An example of the problem which only the address family of the first address is returned: ``` pp TCPSocket.gethostbyname("www.wide.ad.jp") #=> ["www.wide.ad.jp", [], 10, "2001:200:dff:fff1:216:3eff:fe4b:651c", "203.178.137.58"] ``` The address family of the first address, AF_INET6 (10), is returned but the address family of the second address, AF_INET, is not returned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21openssl: merge test fix from upstreamrhe
Merge a commit from upstream: d1cbf6d75280 test/test_ssl_session: skip tests for session_remove_cb Tests using SSL::SSLContext#session_remove_cb= are now skipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21fix OpenSSL::SSL::SSLContext#min_version doesn't worknaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove not used node_type NODE_CVDECLyui-knk
* compile.c (defined_expr0): This node_type has not been used since r11614. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node): ditto * node.h (node_type, NEW_CVDECL): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove not used node_type NODE_IASGN2yui-knk
* compile.c (compile_massign_opt, iseq_compile_each0): This node_type has not been used since r11813. * ext/objspace/objspace.c (count_nodes): ditto * node.c (dump_node, rb_gc_mark_node): ditto * node.h (node_type, NEW_IASGN2): ditto * parse.y (node_assign_gen): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Added explicitly require to example code.hsbt
https://github.com/ruby/ruby/pull/1666 Patch by @guilherme [fix GH-1666] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Use caller with length to reduce unused stringskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Describe recommended-methods.akr
Addrinfo.getaddrinfo is recommended instead of Socket.gethostbyname. Addrinfo#getnameinfo is recommended instead of Socket.gethostbyaddr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21sysconfdir on Windowsnobu
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on Windows. [ruby-core:43110] [Bug #6121] * win32/Makefile.sub (config.status): sysconfdir is not used on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21kill "discards ‘const’ qualifier" warningkosaki
Kill following warning. ../../../ext/psych/yaml/emitter.c: In function ‘yaml_emitter_write_block_scalar_hints’: ../../../ext/psych/yaml/emitter.c:2196:20: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] chomp_hint = "-"; ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21kill "discards ‘const’ qualifier" warningkosaki
Kill following warning. ../../../ext/psych/yaml/emitter.c: In function ‘yaml_emitter_write_folded_scalar’: ../../../ext/psych/yaml/emitter.c:2283:5: warning: passing argument 2 of ‘yaml_emitter_write_indicator’ discards ‘const’ qualifier from pointer target type [enabled by default] if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0)) ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Deprecation document for gethostbyname,gethostbyaddr.akr
[Feature #13097] I confirmed current ruby (Ruby 2.4 and trunk) uses gethostbyname() and gethostbyaddr(). Socket.gethostbyname uses getaddrinfo() and gethostbyname(). Socket.gethostbyaddr uses gethostbyaddr(). Socket.gethostbyname uses gethostbyname() to obtain alias hostnames. RFC 3493 defines getaddrinfo()/getnameinfo() and describes the problems of gethostbyname()/gethostbyaddr(). The problems are difficult protocol handling and thread-unsafety. Since Ruby has GVL, the thread-unsafety doesn't cause wrong result. But it may block other threads until finishing DNS query. Socket.gethostbyname has the protocol handling problem. It returns only one address family: ``` % ruby -rpp -rsocket -e 'pp Socket.gethostbyname("www.wide.ad.jp")' ["www.wide.ad.jp", [], 10, " \x01\x02\x00\r\xFF\xFF\xF1\x02\x16>\xFF\xFEKe\x1C", "\xCB\xB2\x89:"] ``` www.wide.ad.jp has one IPv6 address and one IPv4 address. But Socket.gethostbyname returns only one address family, 10 (AF_INET6), which is the address family of the first address. Also, Socket.gethostbyname and Socket.gethostbyaddr uses 4-bytes binary IPv4 address and 16-bytes binary IPv6 address. This is not usual in other socket API in Ruby. (Most socket API uses binary sockaddr string or Addrinfo object) I think Socket.gethostbyname and Socket.gethostbyaddr are too far from recommendable API. So, I added deprecation description for documents for them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21kill "value computed is not used" warningkosaki
Currently, gcc claims your coding style is not good. Shut it up. ../../../ext/psych/yaml/emitter.c: In function ‘yaml_emitter_write_plain_scalar’: ../../../ext/psych/yaml/emitter.c:28:6: warning: value computed is not used [-Wunused-value] && ((emitter->line_break == YAML_CR_BREAK ? \ ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21kill variable set but not used warningkosaki
Currently, dummy_mark variable makes following warnings. Let's fix it. ../../../ext/psych/yaml/parser.c: In function ‘yaml_parser_parse_block_sequence_entry’: ../../../ext/psych/yaml/parser.c:762:21: warning: variable ‘dummy_mark’ set but not used [-Wunused-but-set-variable] yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21kill "variable set but not used" warningkosaki
Currently, scanner.c makes following warning. Fix it. ../../../ext/psych/yaml/scanner.c: In function ‘yaml_parser_decrease_flow_level’: ../../../ext/psych/yaml/scanner.c:1189:23: warning: variable ‘dummy_key’ set but not used [-Wunused-but-set-variable] yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21add example for Socket.gethostbyaddr.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Treat REG_NONE just like REG_BINARYusa
* ext/win32/lib/win32/registry.rb (read, write): treat REG_NONE just like REG_BINARY when reading and writing. cf. [Bug #7526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21imemo_mask (enum) -> IMEMO_MASK (immediate value).ko1
* internal.h: imemo_mask is not a valid imemo type but switch statements show warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21declare variables once for each line in pathname.c.akr
This ease adding/deleting variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Replace NODE_ALLOCA with T_IMEMO (imemo_alloc)mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Pathname#glob method implemented.akr
[ruby-core:49373] [Feature #7360] proposed by Alexander E. Fischer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Replace `to_a[1..-1]` on a MatchData with `captures`knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove redundant calls of String#chrknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-19lexer.rb: no dedent strings in middlenobu
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): dedent only strings at the beginning, not strings in middle. [ruby-core:83343] [Bug #14027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-11socket.c: null byte at Socket.getnameinfonobu
* ext/socket/socket.c (sock_s_getnameinfo): check null byte. patched by tommy (Masahiro Tomita) in [ruby-dev:50286]. [Bug #13994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-07zlib.c: ensure to freenobu
* ext/zlib/zlib.c (zlib_gunzip): gz0 is a structure variable on the stack, no longer valid after exit by an exception. ensure to free instead. [Bug #13982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-06zlib.c: memory leak in gunzipnobu
* ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak. [ruby-core:83162] [Bug #13982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30dbm.c: suppress unused-but-set-variable warningnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30gdbm.c: use the default external encodingnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-30dbm.c: removed useless assignmentsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e