Skip to content

Commit 22fca50

Browse files
committed
Use rb_block_call() instead of the deprecated rb_iterate() in OpenSSL
* Like ruby/openssl#448
1 parent 710a1a2 commit 22fca50

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/c/openssl/ossl_ssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static VALUE eSSLErrorWaitReadable;
3333
static VALUE eSSLErrorWaitWritable;
3434

3535
static ID id_call, ID_callback_state, id_tmp_dh_callback, id_tmp_ecdh_callback,
36-
id_npn_protocols_encoded;
36+
id_npn_protocols_encoded, id_each;
3737
static VALUE sym_exception, sym_wait_readable, sym_wait_writable;
3838

3939
static ID id_i_cert_store, id_i_ca_file, id_i_ca_path, id_i_verify_mode,
@@ -609,7 +609,7 @@ static VALUE
609609
ssl_encode_npn_protocols(VALUE protocols)
610610
{
611611
VALUE encoded = rb_str_new(NULL, 0);
612-
rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);
612+
rb_block_call(protocols, id_each, 0, 0, ssl_npn_encode_protocol_i, encoded);
613613
return encoded;
614614
}
615615

@@ -2926,6 +2926,7 @@ Init_ossl_ssl(void)
29262926
id_tmp_dh_callback = rb_intern("tmp_dh_callback");
29272927
id_tmp_ecdh_callback = rb_intern("tmp_ecdh_callback");
29282928
id_npn_protocols_encoded = rb_intern("npn_protocols_encoded");
2929+
id_each = rb_intern("each");
29292930

29302931
#define DefIVarID(name) do \
29312932
id_i_##name = rb_intern("@"#name); while (0)

0 commit comments

Comments
 (0)