Skip to content

Commit 99f85dd

Browse files
committed
ssl: remove useless call to rb_thread_wait_fd()
That there is no immediately readable data in the SSL instance does not imply it has to read more bytes from the underlying socket. Just call SSL_read() and check the return value.
1 parent 5f79da4 commit 99f85dd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

ext/openssl/ossl_ssl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,8 +1700,6 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
17001700
io = rb_attr_get(self, id_i_io);
17011701
GetOpenFile(io, fptr);
17021702
if (ssl_started(ssl)) {
1703-
if(!nonblock && SSL_pending(ssl) <= 0)
1704-
rb_thread_wait_fd(FPTR_TO_FD(fptr));
17051703
for (;;){
17061704
nread = SSL_read(ssl, RSTRING_PTR(str), RSTRING_LENINT(str));
17071705
switch(ssl_get_error(ssl, nread)){

0 commit comments

Comments
 (0)