aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/lib/openssl
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-26 22:41:44 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-26 22:41:44 +0000
commit988ca60565a5ba6661f7215026f008afebcf7aee (patch)
treebc196f4e6ce27e3ea505c18269a08f3910b99ba5 /ext/openssl/lib/openssl
parenteadad2c9000f8cc1d5ef58d7d58569793f3db901 (diff)
downloadruby-988ca60565a5ba6661f7215026f008afebcf7aee.tar.gz
* io.c (io_read_nonblock): support non-blocking reads without raising
exceptions. As in: `io.read_nonblock(size, exception: false)` [ruby-core:38666] [Feature #5138] * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto * ext/stringio/stringio.c (strio_sysread): ditto * io.c (rb_io_write_nonblock): support non-blocking writes without raising an exception. * ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto * test/openssl/test_pair.rb (class OpenSSL): tests * test/ruby/test_io.rb (class TestIO): ditto * test/socket/test_nonblock.rb (class TestSocketNonblock): ditto * test/stringio/test_stringio.rb (class TestStringIO): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/lib/openssl')
-rw-r--r--ext/openssl/lib/openssl/buffering.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index 51bc968e3a..e40dfee667 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -161,7 +161,7 @@ module OpenSSL::Buffering
# when the peer requests a new TLS/SSL handshake. See openssl the FAQ for
# more details. http://www.openssl.org/support/faq.html
- def read_nonblock(maxlen, buf=nil)
+ def read_nonblock(maxlen, buf=nil, exception: true)
if maxlen == 0
if buf
buf.clear
@@ -171,7 +171,7 @@ module OpenSSL::Buffering
end
end
if @rbuffer.empty?
- return sysread_nonblock(maxlen, buf)
+ return sysread_nonblock(maxlen, buf, exception: exception)
end
ret = consume_rbuff(maxlen)
if buf
@@ -370,9 +370,9 @@ module OpenSSL::Buffering
# is when the peer requests a new TLS/SSL handshake. See the openssl FAQ
# for more details. http://www.openssl.org/support/faq.html
- def write_nonblock(s)
+ def write_nonblock(s, exception: true)
flush
- syswrite_nonblock(s)
+ syswrite_nonblock(s, exception: exception)
end
##