Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-08-16 01:30:47 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-11-08 17:01:02 +0400
commit014ab77276378ed9be918e77cf07fb7e6ad6b424 (patch)
tree8eec01419ed20dc1db29462cac2389949b0e060f /src/node_crypto_bio.h
parentea8feced871849715608cc47618d8ee1cf82742b (diff)
crypto: try moving read head in Peek()
Otherwise it might get stall (`Peek()` will return zero-length chunk) in following situation: 1. `Write(kBufferLength)` 2. `Read(kBufferLength)` 3. `Write(anything)` 4. `Peek()` => `len=0`
Diffstat (limited to 'src/node_crypto_bio.h')
-rw-r--r--src/node_crypto_bio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h
index 865c7ca6c3c..615fea944e4 100644
--- a/src/node_crypto_bio.h
+++ b/src/node_crypto_bio.h
@@ -38,6 +38,9 @@ class NodeBIO {
static BIO* New();
+ // Move read head to next buffer if needed
+ void TryMoveReadHead();
+
// Allocate new buffer for write if needed
void TryAllocateForWrite();