Browse Source

crypto: fix changing buffers in bio

We should go to next buffer if *current* one is full, not the next one.
Otherwise we may hop through buffers and written data will become
interleaved, which will lead to failure.
v0.10.4-release
Fedor Indutny 12 years ago
parent
commit
ba0f7b8066
  1. 2
      src/node_crypto_bio.cc

2
src/node_crypto_bio.cc

@ -279,7 +279,7 @@ void NodeBIO::Write(const char* data, size_t size) {
// Go to next buffer if there still are some bytes to write
if (left != 0) {
if (write_head_->next_->write_pos_ == kBufferLength) {
if (write_head_->write_pos_ == kBufferLength) {
Buffer* next = new Buffer();
next->next_ = write_head_->next_;
write_head_->next_ = next;

Loading…
Cancel
Save