Skip to content
Browse files

crypto: zero is not an error if writing 0 bytes

fix #5128
  • Loading branch information...
1 parent bd0d458 commit 8910184f46fc13f831d3a09984c80021a49bc6a2 @indutny committed Apr 7, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/node_crypto.cc
View
4 src/node_crypto.cc
@@ -1476,7 +1476,9 @@ Handle<Value> Connection::ClearIn(const Arguments& args) {
int bytes_written = SSL_write(ss->ssl_, buffer_data + off, len);
- ss->HandleSSLError("SSL_write:ClearIn", bytes_written, kZeroIsAnError);
+ ss->HandleSSLError("SSL_write:ClearIn",
+ bytes_written,
+ len == 0 ? kZeroIsNotAnError : kZeroIsAnError);
ss->SetShutdownFlags();
return scope.Close(Integer::New(bytes_written));

0 comments on commit 8910184

Please sign in to comment.
Something went wrong with that request. Please try again.