diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-07-06 19:25:22 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-07-06 19:25:22 +0200 |
commit | b8e4852dcc7cd4b954556001b2bfb1d01b802d0a (patch) | |
tree | 815b3da7c6f3fad870367af19520edc44db12776 /ext/openssl | |
parent | ec14a87f4faff61ffedebd99d94f063ee022b665 (diff) | |
download | ruby-openssl-b8e4852dcc7cd4b954556001b2bfb1d01b802d0a.tar.gz |
Use rb_block_call() instead of the deprecated rb_iterate() in OpenSSL
* See https://bugs.ruby-lang.org/issues/18025
and https://github.com/ruby/ruby/pull/4629
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index de50a396..910e902d 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -39,7 +39,7 @@ static VALUE eSSLErrorWaitReadable; static VALUE eSSLErrorWaitWritable; static ID id_call, ID_callback_state, id_tmp_dh_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, @@ -583,7 +583,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; } @@ -2864,6 +2864,7 @@ Init_ossl_ssl(void) id_tmp_dh_callback = rb_intern_const("tmp_dh_callback"); id_npn_protocols_encoded = rb_intern_const("npn_protocols_encoded"); + id_each = rb_intern_const("each"); #define DefIVarID(name) do \ id_i_##name = rb_intern_const("@"#name); while (0) |