diff options
author | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2002-07-23 10:49:19 +0000 |
---|---|---|
committer | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2002-07-23 10:49:19 +0000 |
commit | a8cc83a810bef0f34d0e1930f2f08c739634b4ec (patch) | |
tree | 8c46e6c37310edd35afdfeff49ce2adcaf260756 | |
parent | 9dab048c26f6b039a31d5d3030bf0c35af39f831 (diff) | |
download | ruby-openssl-history-a8cc83a810bef0f34d0e1930f2f08c739634b4ec.tar.gz |
* ossl_ssl.c: raise exception while SSL_write returns 0.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ossl_ssl.c | 3 |
2 files changed, 8 insertions, 4 deletions
@@ -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 @@ -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."); |