diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2022-10-07 23:02:37 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 23:02:37 +1300 |
commit | 65876bd39501a893b24ebf245e36f2b4f4dcc7b7 (patch) | |
tree | 0dac665a8fd4a19e70fb2f231652a7811857e9ea /ext | |
parent | 173be6690589120976bd3f8e55eea13eae6aed46 (diff) | |
download | ruby-openssl-65876bd39501a893b24ebf245e36f2b4f4dcc7b7.tar.gz |
Use default `IO#timeout` if possible. (#547)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index abfc12d9..ab247915 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1701,11 +1701,15 @@ no_exception_p(VALUE opts) return 0; } +#ifndef RB_IO_TIMEOUT_DEFAULT +#define RB_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, Qnil); + rb_io_maybe_wait_writable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT); #else rb_io_wait_writable(fptr->fd); #endif @@ -1715,7 +1719,7 @@ static void io_wait_readable(rb_io_t *fptr) { #ifdef HAVE_RB_IO_MAYBE_WAIT - rb_io_maybe_wait_readable(errno, fptr->self, Qnil); + rb_io_maybe_wait_readable(errno, fptr->self, RB_IO_TIMEOUT_DEFAULT); #else rb_io_wait_readable(fptr->fd); #endif |