Permalink
Browse files

[tls] if we failed to write first chunk - total_bytes_written should …

…be <= 0 , not just 0
  • Loading branch information...
1 parent d6cc47f commit 1807d90a538e2d156db3e33c482ca253312edf6d @indutny committed Apr 21, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/node_crypto.cc
View
@@ -974,6 +974,11 @@ Handle<Value> Connection::ClearIn(const Arguments& args) {
// Written nothing at all
if (bytes_written <= 0) {
+ // If we has failed to write first chunk
+ // total_bytes_written can have negative value
+ if (total_bytes_written == 0) {
+ total_bytes_written += bytes_written;
+ }
break;
}

0 comments on commit 1807d90

Please sign in to comment.