crypto: change assertion to condition in bio
authorFedor Indutny <fedor.indutny@gmail.com>
Wed, 19 Jun 2013 08:16:59 +0000 (10:16 +0200)
committerFedor Indutny <fedor.indutny@gmail.com>
Wed, 19 Jun 2013 20:03:07 +0000 (22:03 +0200)
Read head can be the same as write head, even if there's some data to
read.

src/node_crypto_bio.cc

index adb1e33..9afaa3d 100644 (file)
@@ -209,8 +209,7 @@ size_t NodeBIO::Read(char* out, size_t size) {
       read_head_->write_pos_ = 0;
 
       // But not get beyond write_head_
-      if (length_ != bytes_read) {
-        assert(read_head_ != write_head_);
+      if (length_ != bytes_read && read_head_ != write_head_) {
         read_head_ = read_head_->next_;
       }
     }