summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ssl.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-15 17:50:47 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-15 17:50:47 +0000
commit0f2fa01a20d0e08e59f12e183a86619b587edb5c (patch)
tree42fd914ee129fd5ee85e152c6032341a2d0f3a61 /ext/openssl/ossl_ssl.c
parent70a05a3e82c9e47757caf8d2873cf3bc80ec22d9 (diff)
downloadruby-0f2fa01a20d0e08e59f12e183a86619b587edb5c.tar.gz
ruby-0f2fa01a20d0e08e59f12e183a86619b587edb5c.tar.xz
ruby-0f2fa01a20d0e08e59f12e183a86619b587edb5c.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@7974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_ssl.c')
-rw-r--r--ext/openssl/ossl_ssl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 89c4ec1c6..e85430e85 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:");
}