@@ -1532,6 +1532,26 @@ no_exception_p(VALUE opts)
1532
1532
return 0 ;
1533
1533
}
1534
1534
1535
+ static void
1536
+ io_wait_writable (rb_io_t * fptr )
1537
+ {
1538
+ #ifdef HAVE_RB_IO_MAYBE_WAIT
1539
+ rb_io_maybe_wait_writable (errno , fptr -> self , Qnil );
1540
+ #else
1541
+ rb_io_wait_writable (fptr -> fd );
1542
+ #endif
1543
+ }
1544
+
1545
+ static void
1546
+ io_wait_readable (rb_io_t * fptr )
1547
+ {
1548
+ #ifdef HAVE_RB_IO_MAYBE_WAIT
1549
+ rb_io_maybe_wait_readable (errno , fptr -> self , Qnil );
1550
+ #else
1551
+ rb_io_wait_readable (fptr -> fd );
1552
+ #endif
1553
+ }
1554
+
1535
1555
static VALUE
1536
1556
ossl_start_ssl (VALUE self , int (* func )(), const char * funcname , VALUE opts )
1537
1557
{
@@ -1566,12 +1586,12 @@ ossl_start_ssl(VALUE self, int (*func)(), const char *funcname, VALUE opts)
1566
1586
case SSL_ERROR_WANT_WRITE :
1567
1587
if (no_exception_p (opts )) { return sym_wait_writable ; }
1568
1588
write_would_block (nonblock );
1569
- rb_io_wait_writable (fptr -> fd );
1589
+ io_wait_writable (fptr );
1570
1590
continue ;
1571
1591
case SSL_ERROR_WANT_READ :
1572
1592
if (no_exception_p (opts )) { return sym_wait_readable ; }
1573
1593
read_would_block (nonblock );
1574
- rb_io_wait_readable (fptr -> fd );
1594
+ io_wait_readable (fptr );
1575
1595
continue ;
1576
1596
case SSL_ERROR_SYSCALL :
1577
1597
#ifdef __APPLE__
@@ -1749,12 +1769,12 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
1749
1769
case SSL_ERROR_WANT_WRITE :
1750
1770
if (no_exception_p (opts )) { return sym_wait_writable ; }
1751
1771
write_would_block (nonblock );
1752
- rb_io_wait_writable (fptr -> fd );
1772
+ io_wait_writable (fptr );
1753
1773
continue ;
1754
1774
case SSL_ERROR_WANT_READ :
1755
1775
if (no_exception_p (opts )) { return sym_wait_readable ; }
1756
1776
read_would_block (nonblock );
1757
- rb_io_wait_readable (fptr -> fd );
1777
+ io_wait_readable (fptr );
1758
1778
continue ;
1759
1779
case SSL_ERROR_SYSCALL :
1760
1780
if (!ERR_peek_error ()) {
@@ -1865,12 +1885,12 @@ ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
1865
1885
case SSL_ERROR_WANT_WRITE :
1866
1886
if (no_exception_p (opts )) { return sym_wait_writable ; }
1867
1887
write_would_block (nonblock );
1868
- rb_io_wait_writable (fptr -> fd );
1888
+ io_wait_writable (fptr );
1869
1889
continue ;
1870
1890
case SSL_ERROR_WANT_READ :
1871
1891
if (no_exception_p (opts )) { return sym_wait_readable ; }
1872
1892
read_would_block (nonblock );
1873
- rb_io_wait_readable (fptr -> fd );
1893
+ io_wait_readable (fptr );
1874
1894
continue ;
1875
1895
case SSL_ERROR_SYSCALL :
1876
1896
#ifdef __APPLE__
0 commit comments