Skip to content

Commit 65876bd

Browse files
authored
Use default IO#timeout if possible. (#547)
1 parent 173be66 commit 65876bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/openssl/ossl_ssl.c

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

1704+
#ifndef RB_IO_TIMEOUT_DEFAULT
1705+
#define RB_IO_TIMEOUT_DEFAULT Qnil
1706+
#endif
1707+
17041708
static void
17051709
io_wait_writable(rb_io_t *fptr)
17061710
{
17071711
#ifdef HAVE_RB_IO_MAYBE_WAIT
1708-
rb_io_maybe_wait_writable(errno, fptr->self, Qnil);
1712+
rb_io_maybe_wait_writable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
17091713
#else
17101714
rb_io_wait_writable(fptr->fd);
17111715
#endif
@@ -1715,7 +1719,7 @@ static void
17151719
io_wait_readable(rb_io_t *fptr)
17161720
{
17171721
#ifdef HAVE_RB_IO_MAYBE_WAIT
1718-
rb_io_maybe_wait_readable(errno, fptr->self, Qnil);
1722+
rb_io_maybe_wait_readable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT);
17191723
#else
17201724
rb_io_wait_readable(fptr->fd);
17211725
#endif

0 commit comments

Comments
 (0)