Skip to content

Commit 2115cf3

Browse files
authored
Merge pull request #548 from ruby/io-timeout-redux
Use default `IO#timeout` if possible.
2 parents 65876bd + 471340f commit 2115cf3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/openssl/ossl_ssl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,15 +1701,16 @@ no_exception_p(VALUE opts)
17011701
return 0;
17021702
}
17031703

1704-
#ifndef RB_IO_TIMEOUT_DEFAULT
1705-
#define RB_IO_TIMEOUT_DEFAULT Qnil
1704+
// Provided by Ruby 3.2.0 and later in order to support the default IO#timeout.
1705+
#ifndef RUBY_IO_TIMEOUT_DEFAULT
1706+
#define RUBY_IO_TIMEOUT_DEFAULT Qnil
17061707
#endif
17071708

17081709
static void
17091710
io_wait_writable(rb_io_t *fptr)
17101711
{
17111712
#ifdef HAVE_RB_IO_MAYBE_WAIT
1712-
rb_io_maybe_wait_writable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
1713+
rb_io_maybe_wait_writable(errno, fptr->self, RUBY_IO_TIMEOUT_DEFAULT);
17131714
#else
17141715
rb_io_wait_writable(fptr->fd);
17151716
#endif
@@ -1719,7 +1720,7 @@ static void
17191720
io_wait_readable(rb_io_t *fptr)
17201721
{
17211722
#ifdef HAVE_RB_IO_MAYBE_WAIT
1722-
rb_io_maybe_wait_readable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
1723+
rb_io_maybe_wait_readable(errno, fptr->self, RUBY_IO_TIMEOUT_DEFAULT);
17231724
#else
17241725
rb_io_wait_readable(fptr->fd);
17251726
#endif

0 commit comments

Comments
 (0)