diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-28 19:31:48 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-28 19:31:48 +0000 |
commit | e25f3587bd426e87164c82678712571f99f4c2a8 (patch) | |
tree | 2c3d88783ed15bb0525e0514e7486725989d22b1 /ext/openssl/ossl_ssl.c | |
parent | 2ee916752c7be930b2340a0eb8a0c1fcc8714532 (diff) | |
download | ruby-e25f3587bd426e87164c82678712571f99f4c2a8.tar.gz |
* ext/openssl/ossl_ssl.c: pass read_nonblock options to underlying IO
when SSL session has not been started.
* test/openssl/test_ssl.rb: test for change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_ssl.c')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 484e48a01c..a95ab3d1d0 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1431,7 +1431,11 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock) else { ID meth = nonblock ? rb_intern("read_nonblock") : rb_intern("sysread"); rb_warning("SSL session is not started yet."); - return rb_funcall(ossl_ssl_get_io(self), meth, 2, len, str); + if (nonblock) { + return rb_funcall(ossl_ssl_get_io(self), meth, 3, len, str, opts); + } else { + return rb_funcall(ossl_ssl_get_io(self), meth, 2, len, str); + } } end: |