From a579d8bf6818cd979efc441f9bcec849b2d37b3e Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Tue, 15 Feb 2005 17:50:47 +0000 Subject: * ext/openssl/ossl_ssl.c (ossl_ssl_read, ossl_ssl_write): should call rb_sys_fail instead of rasing SSLError if SSL_ERROR_SYSCALL occured. * ext/openssl/lib/openssl/buffering.rb (Buffering#fill_rbuff): should rescue Errno::EAGAIN. * ext/openssl/lib/openssl/buffering.rb (Buffering#each): fix typo. suggested by Brian Ollenberger. * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the underlying IO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_ssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/openssl/ossl_ssl.c') diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 89c4ec1c6c..e85430e859 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -517,7 +517,7 @@ ossl_ssl_read(int argc, VALUE *argv, VALUE self) continue; case SSL_ERROR_SYSCALL: if(ERR_peek_error() == 0 && nread == 0) rb_eof_error(); - ossl_raise(eSSLError, "SSL_read: %s", strerror(errno)); + rb_sys_fail(0); default: ossl_raise(eSSLError, "SSL_read:"); } @@ -556,6 +556,8 @@ ossl_ssl_write(VALUE self, VALUE str) case SSL_ERROR_WANT_READ: rb_thread_schedule(); continue; + case SSL_ERROR_SYSCALL: + rb_eof_error(); default: ossl_raise(eSSLError, "SSL_write:"); } -- cgit v1.2.3