summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2015-09-02win32_vk.inc: merge win32_vk.hnobu
* ext/io/console/win32_vk.inc: merge win32_vk.h not to be included in HDRS on other platforms than Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-29* ext/openssl/ossl_ssl.c (static const struct): Only add SSLv3 supporttenderlove
if the SSL library supports it. Thanks Kurt Roeckx <kurt@roeckx.be> [Bug #11376] * ext/openssl/extconf.rb: check for SSLv3 support in the SSL implementation. * test/openssl/test_ssl.rb (class OpenSSL): Skip tests that need SSLv3 if there is no support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* ext/thread/thread.c: move definitions of Queue, SizedQueueko1
and ConditionalVariables to thread_tools.c. In other wowrds, such classes are built-in. [Feature #8919] At first, I planned to embed only a Queue class. However, rubygems requires 'thread.rb' (rubygems are required at first, when launch MRI without --disable-gems). So most of people require 'thread.rb' as an embedded library. Now, ext/thread/thread.c is empty, only for a dummy for compatibility. * thread.c: move a definition of Mutex class to thread_tools.c. And define Mutex class under Thread (so now Mutex is Thread::Mutex). Because other thread related classes are also defined under Thread. We remain ::Mutex as Thread::Mutex. Only an inspect result is changed. * common.mk: add dependency from thread.o to thraed_tools.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* ext/psych/*: update to Psych 2.0.14tenderlove
* test/psych/*: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.ko1
[Feature #11158] * symbol.c (rb_sym_immortal_count): added to count immortal symbols. * symbol.h: ditto. * test/objspace/test_objspace.rb: add a test for this method. * NEWS: describe about this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-19* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL totenderlove
existing options rather than just setting it. Some vendors apply custom patches to their versions of OpenSSL that set default values for options. This commit respects the custom patches they've applied. * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been added to the options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15ossl_ssl.c: check SSL method namenobu
* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ssl_version): SSL method name must not contain NUL. preserve the encoding of message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-15use rb_sym2strnobu
* 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-15win32/registry.rb: size in bytesnobu
* ext/win32/lib/win32/registry.rb (API#SetValue): data size should be in bytes, not in chars. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14win32/registry.rb: terminator sizenobu
* ext/win32/lib/win32/registry.rb (API#SetValue): add terminator size, not 1 byte. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14win32/registry.rb: make @@type2name an arraynobu
* ext/win32/lib/win32/registry.rb (@@type2name): make an array instead of a hash, keys are sequential numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-10objspace.c: use rb_ident_hash_newnobu
* ext/objspace/objspace.c (reachable_objects_from_root): use rb_ident_hash_new instead of funcall Hash#compare_by_id. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-05* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): movetenderlove
SSLSocket#sysclose to Ruby. * ext/openssl/ossl_ssl.c (ossl_ssl_close): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-05* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move nonblocktenderlove
enable to SSLSocket#initialize and remove Nonblock module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-05* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): movetenderlove
OpenSSL::SSL::SSLSocket#initialize to Ruby. * ext/openssl/ossl_ssl.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-05socket.c: suppress warningsnobu
* 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-05ossl_ssl.c: remove unused variablesnobu
* ext/openssl/ossl_ssl.c (ossl_call_client_cert_cb), (ossl_call_tmp_dh_callback, ossl_call_tmp_ecdh_callback), (ossl_call_session_get_cb, ossl_call_session_new_cb): remove no longer used variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-04* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callbacktenderlove
lookup to private Ruby methods. This means we can keep the default DH callback logic hidden from consumers. Also, since the SSLSocket always has a context, we can remove conditionals about that instance. * ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-02tcltklib.c: check argumentnobu
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-01openssl/buffering: fix gets on EOF with limitnormal
* ext/openssl/lib/openssl/buffering.rb (gets): avoid comparing fixnum with nil * test/openssl/test_pair.rb: test gets with limit when EOF is hit Thanks to Bar Hofesh <bar.hofesh@safe-t.com> for the bug report and testing. [ruby-core:70149] [Bug #11400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-01* ext/openssl/ossl_ssl.c (ossl_sslctx_setup): Implementtenderlove
SSLContext#options and options= using SSL_CTX_set_options and SSL_CTX_get_options. This reduces the number of ivars we need and simplifies `ossl_sslctx_setup`. * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Default `options` to SSL_OP_ALL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/ossl_ssl.c (Init_ossl_ssl): OpenSSL declares thesetenderlove
constants as longs, so we should follow that and use LONG2NUM. http://git.io/vOqxD git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): change callbacktenderlove
to return the Ruby dh (or ecdh) object that the caller cares about instead of doing rb_iv_get / set to communicate. This means we can remove an rb_iv_get call, and only use the set calls for their intended purpose (to prevent the object from being GC'd). * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto * ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): ditto * ext/openssl/ossl_ssl.c (ossl_tmp_ecdh_callback): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): Similarly to thetenderlove
tmp_ecdh_callback, the SSLSocket instance always holds a reference to the SSLContext object (it's always set in `initialize`). The SSLContext holds a reference to the tmp_dh_callback. Ask the context for the callback instead of storing the callback in two places. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/ossl_ssl.c (ossl_call_tmp_dh_callback): create an arraytenderlove
and use `rb_apply` to clean up calls to `rb_protect`. * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/ossl_ssl.c (ossl_call_tmp_ecdh_callback): The SSL sockettenderlove
always holds a reference to the SSLContext object, which will have the callback object. Ask the context for the callback instead of storing the callback in two places. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-31* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): converttenderlove
`tmp_dh_callback` to Ruby, and call it when setting up an SSL connection. This allows us to move the "default" behavior to the reader method. * ext/openssl/ossl_ssl.c: call the tmp_dh_callback instead of accessing the SSLContext's internals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-29fiddle: $LOCAL_LIBS needs to be expandednobu
* ext/fiddle/extconf.rb: revert part of r51401 and expand $LOCAL_LIBS as it will be extracted and copied to exts.mk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-27* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): raise a moretenderlove
helpful exception when verifying the peer connection and an anonymous cipher has been selected. [ruby-core:68330] [Bug #10910] Thanks to Chris Sinjakli <chris@sinjakli.co.uk> for the patch. * test/openssl/test_ssl.rb (class OpenSSL): test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-27fiddle: clean dot dirnobu
* ext/fiddle/depend (distclean-libffi): clean dot directory too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-27fiddle: unexpand LIBFFI_DIRnobu
* ext/fiddle/extconf.rb: use LIBFFI_DIR instead of expanding it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-27io/console/extconf.rb: fix typonobu
* ext/io/console/extconf.rb: fix typo, $nmake is "m" for MS, not "n". check sys/ioctl.h iff necessary for tty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-26ossl_ssl.c: fix conditionnobu
* ext/openssl/ossl_ssl.c (ossl_ssl_alpn_protocol): fix condition to compile, needs ALPN to be available. [Feature #9390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-26* ext/openssl/ossl_ssl.c (ossl_call_servername_cb): set the ssl contexttenderlove
object returned by the servername callback on to the socket as an instance variable. If the callback allocated a new context object and didn't keep a reference to it, it could be GC'd out from under the socket object. * test/openssl/test_ssl.rb (class OpenSSL): test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-25* ext/openssl/lib/openssl/pkey.rb: implement DEFAULT_512 andtenderlove
DEFAULT_1024 constants in Ruby. * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): Ask PKey for the default DH callback since it aleady must check whether openssl has been compiled with DH support. * ext/openssl/ossl_pkey_dh.c (OSSL_PKEY_BN): Remove C definitions of DEFAULT_512 and DEFAULT_1024 * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto * test/openssl/test_pkey_dh.rb (class OpenSSL): add test to ensure the Ruby definitions are the same as the C definitions were. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-25* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): supporttenderlove
specifically setting the tmp_dh_callback to nil. * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto * test/openssl/test_pair.rb (module OpenSSL): add a test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-25* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): move the defaulttenderlove
tmp_dh_callback Ruby code and set it as a default in `initialize`. * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_512_GEN): move this constant to Ruby. * ext/openssl/ossl_pkey_dh.c (static unsigned char DEFAULT_DH_1024_GEN): ditto * ext/openssl/ossl_pkey_dh.c (Init_ossl_dh): ditto * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): tmp_dh_callback should always be set, so we can remove this conditional git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-25* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add missingtenderlove
instance variables to squash warnings with alpn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-25* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): movetenderlove
OpenSSL::SSL::SSLContext#initialize implementation to pure Ruby. * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): ditto * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-24string.c: pool only bare strings in fstringnobu
* string.c (fstr_update_callback): pool bare strings only. * string.c (rb_fstring): return the original string with sharing a fstring if it has extra attributes, not the fstring itself. [ruby-dev:49188] [Bug #11386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-23ossl_ssl.c: suppress warningsnobu
* ext/openssl/ossl_ssl.c (ossl_sslctx_setup): fix argument types to suppress shorten-64-to-32 and shorten-64-to-32 warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-22fix tests bu not setting the string instance on the frozen objecttenderlove
OpenSSL [copies the string returned by the pointe](https://github.com/openssl/openssl/blob/9f040d6decca7930e978784c917f731e5c45e8f0/ssl/t1_lib.c#L1800-1809), so it should be safe to just return a pointer to the string object and not set an instance variable on the already frozen object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-22* ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356]tenderlove
* test/openssl/test_pair.rb: test for ECDH callback support git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-22* ext/openssl/ossl_ssl.c: add ALPN support. [Feature #9390]tenderlove
* ext/openssl/extconf.rb: detect ALPN support in OpenSSL * test/openssl/test_ssl.rb: test for ALPN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* make rb_iseq_t T_IMEMO object (type is imemo_iseq).ko1
All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data. * compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE). * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq). * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq. * gc.c: check T_IMEMO/iseq. * internal.h: add imemo_type::imemo_iseq. * iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_.... * load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq). * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq). * vm_core.h (GetISeqPtr): removed because it is not T_DATA now. * vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* ext/objspace/objspace.c (total_i): no need to skip singleton classes.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21console.c: undefined vknobu
* ext/io/console/console.c (console_key_pressed_p): raise undefined virtual key code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21ruby/win32.h: include windows.hnobu
* 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-19pty.c: fix example typo [ci skip]nobu
* ext/pty/pty.c: [DOC] fix example typo, an old name at move from PTY.open. [Fix GH-972] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-15encoding.c: drop dummy encoding flagnobu
* encoding.c (enc_autoload): drop dummy encoding flag from the loaded encoding index. this flag is used only in this source. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e