aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-08-25 20:26:09 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-08-25 20:26:09 +0900
commit99f85dd6fa80e650132b9373587e2963f6abd058 (patch)
tree2d362e7ae182c3aca7d82f619c695eea59ab9939
parent5f79da4812d2bafd92a964a63875cda8f76a8045 (diff)
downloadruby-openssl-ky/ssl-sysread-dont-check-ssl-pending.tar.gz
ssl: remove useless call to rb_thread_wait_fd()ky/ssl-sysread-dont-check-ssl-pending
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.
-rw-r--r--ext/openssl/ossl_ssl.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index f0462eda..bf40c5b1 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1700,8 +1700,6 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
io = rb_attr_get(self, id_i_io);
GetOpenFile(io, fptr);
if (ssl_started(ssl)) {
- if(!nonblock && SSL_pending(ssl) <= 0)
- rb_thread_wait_fd(FPTR_TO_FD(fptr));
for (;;){
nread = SSL_read(ssl, RSTRING_PTR(str), RSTRING_LENINT(str));
switch(ssl_get_error(ssl, nread)){