aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-07-06 19:25:22 +0200
committerKazuki Yamaguchi <k@rhe.jp>2021-09-27 00:15:30 +0900
commit657a4736d2ad723bbcd66c603677a77b8ee4eacc (patch)
treec9d5d5dff7afaa7b638b1d1cbdf2dd63a7eb1fb7
parentb74e43bd71b9870e335da0120f5314cd6096e7e9 (diff)
downloadruby-openssl-657a4736d2ad723bbcd66c603677a77b8ee4eacc.tar.gz
Use rb_block_call() instead of the deprecated rb_iterate() in OpenSSL
[ This is a backport to the 2.1 branch. ] * See https://bugs.ruby-lang.org/issues/18025 and https://github.com/ruby/ruby/pull/4629 (cherry picked from commit b8e4852dcc7cd4b954556001b2bfb1d01b802d0a)
-rw-r--r--ext/openssl/ossl_ssl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index f4271369..a9e3948e 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -33,7 +33,7 @@ static VALUE eSSLErrorWaitReadable;
static VALUE eSSLErrorWaitWritable;
static ID id_call, ID_callback_state, id_tmp_dh_callback, id_tmp_ecdh_callback,
- id_npn_protocols_encoded;
+ id_npn_protocols_encoded, id_each;
static VALUE sym_exception, sym_wait_readable, sym_wait_writable;
static ID id_i_cert_store, id_i_ca_file, id_i_ca_path, id_i_verify_mode,
@@ -616,7 +616,7 @@ static VALUE
ssl_encode_npn_protocols(VALUE protocols)
{
VALUE encoded = rb_str_new(NULL, 0);
- rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);
+ rb_block_call(protocols, id_each, 0, 0, ssl_npn_encode_protocol_i, encoded);
return encoded;
}
@@ -2960,6 +2960,7 @@ Init_ossl_ssl(void)
id_tmp_dh_callback = rb_intern("tmp_dh_callback");
id_tmp_ecdh_callback = rb_intern("tmp_ecdh_callback");
id_npn_protocols_encoded = rb_intern("npn_protocols_encoded");
+ id_each = rb_intern_const("each");
#define DefIVarID(name) do \
id_i_##name = rb_intern("@"#name); while (0)