aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGOTOU Yuuzou <gotoyuzo@notwork.org>2002-07-23 10:49:19 +0000
committerGOTOU Yuuzou <gotoyuzo@notwork.org>2002-07-23 10:49:19 +0000
commita8cc83a810bef0f34d0e1930f2f08c739634b4ec (patch)
tree8c46e6c37310edd35afdfeff49ce2adcaf260756
parent9dab048c26f6b039a31d5d3030bf0c35af39f831 (diff)
downloadruby-openssl-history-a8cc83a810bef0f34d0e1930f2f08c739634b4ec.tar.gz
* ossl_ssl.c: raise exception while SSL_write returns 0.
-rw-r--r--ChangeLog9
-rw-r--r--ossl_ssl.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 80e8466..acc2cff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,10 +4,13 @@ Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
All rights reserved.
$Log$
+Revision 1.39 2002/07/23 10:49:19 gotoyuzo
+ * ossl_ssl.c: raise exception while SSL_write returns 0.
+
Revision 1.38 2002/07/23 10:45:25 gotoyuzo
-* ossl.h: include <openssl/e_os.h>
-* ossl.c: workaround to convert into UTC time.
-* lib/openssl.rb: fix string embeded expression.
+ * ossl.h: include <openssl/e_os.h>
+ * ossl.c: workaround to convert into UTC time.
+ * lib/openssl.rb: fix string embeded expression.
Revision 1.37 2002/04/07 16:35:32 majkl
* Macros fixups
diff --git a/ossl_ssl.c b/ossl_ssl.c
index de0bbb4..5836813 100644
--- a/ossl_ssl.c
+++ b/ossl_ssl.c
@@ -391,8 +391,9 @@ ssl_write(VALUE self, VALUE str)
str = rb_String(str);
if (p->ssl) {
+ if(RSTRING(str)->len == 0) return INT2NUM(0);
nwrite = SSL_write(p->ssl, RSTRING(str)->ptr, RSTRING(str)->len);
- if (nwrite < 0)
+ if (nwrite <= 0)
OSSL_Raise(eSSLError, "SSL_write:");
} else {
rb_warning("SSL session is not started yet.");