[前][次][番号順一覧][スレッド一覧]

ruby-changes:74045

From: Samuel <ko1@a...>
Date: Mon, 17 Oct 2022 16:43:34 +0900 (JST)
Subject: [ruby-changes:74045] aecc470a33 (master): [ruby/openssl] Use default `IO#timeout` if possible.

https://git.ruby-lang.org/ruby.git/commit/?id=aecc470a33

From aecc470a3354bbf61e5cd2e65f4aeb4f3825a9be Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@o...>
Date: Fri, 7 Oct 2022 23:05:17 +1300
Subject: [ruby/openssl] Use default `IO#timeout` if possible.

https://github.com/ruby/openssl/commit/471340f612
---
 ext/openssl/ossl_ssl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index a202109b7a..478ff869a4 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1701,15 +1701,16 @@ no_exception_p(VALUE opts) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_ssl.c#L1701
     return 0;
 }
 
-#ifndef RB_IO_TIMEOUT_DEFAULT
-#define RB_IO_TIMEOUT_DEFAULT Qnil
+// Provided by Ruby 3.2.0 and later in order to support the default IO#timeout.
+#ifndef RUBY_IO_TIMEOUT_DEFAULT
+#define RUBY_IO_TIMEOUT_DEFAULT Qnil
 #endif
 
 static void
 io_wait_writable(rb_io_t *fptr)
 {
 #ifdef HAVE_RB_IO_MAYBE_WAIT
-    rb_io_maybe_wait_writable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
+    rb_io_maybe_wait_writable(errno, fptr->self, RUBY_IO_TIMEOUT_DEFAULT);
 #else
     rb_io_wait_writable(fptr->fd);
 #endif
@@ -1719,7 +1720,7 @@ static void https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_ssl.c#L1720
 io_wait_readable(rb_io_t *fptr)
 {
 #ifdef HAVE_RB_IO_MAYBE_WAIT
-    rb_io_maybe_wait_readable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
+    rb_io_maybe_wait_readable(errno, fptr->self, RUBY_IO_TIMEOUT_DEFAULT);
 #else
     rb_io_wait_readable(fptr->fd);
 #endif
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]