mirror of
https://github.com/ruby/ruby.git
synced 2026-11-08 01:20:26 +08:00
[ruby/openssl] ssl: remove dependency on io/nonblock
Use C API rb_io_set_nonblock() instead. https://github.com/ruby/openssl/commit/7bf23b629e
This commit is contained in:
parent
9fc86fc5f9
commit
e67e4a6960
@ -15,7 +15,6 @@ require "openssl/buffering"
|
||||
if defined?(OpenSSL::SSL)
|
||||
|
||||
require "io/wait" if RUBY_VERSION < "3.2"
|
||||
require "io/nonblock"
|
||||
require "ipaddr"
|
||||
require "socket"
|
||||
|
||||
|
||||
@ -1766,8 +1766,6 @@ ossl_ssl_initialize(int argc, VALUE *argv, VALUE self)
|
||||
rb_ivar_set(self, id_original_context, v_ctx);
|
||||
ossl_sslctx_setup(v_ctx);
|
||||
|
||||
if (rb_respond_to(io, rb_intern("nonblock=")))
|
||||
rb_funcall(io, rb_intern("nonblock="), 1, Qtrue);
|
||||
Check_Type(io, T_FILE);
|
||||
rb_ivar_set(self, id_i_io, io);
|
||||
|
||||
@ -1811,6 +1809,7 @@ ossl_ssl_setup(VALUE self)
|
||||
GetOpenFile(io, fptr);
|
||||
rb_io_check_readable(fptr);
|
||||
rb_io_check_writable(fptr);
|
||||
rb_io_set_nonblock(fptr);
|
||||
if (!SSL_set_fd(ssl, TO_SOCKET(rb_io_descriptor(io))))
|
||||
ossl_raise(eSSLError, "SSL_set_fd");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user