aboutsummaryrefslogtreecommitdiff
path: root/src/tls_wrap.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-12-27 19:27:29 +0100
committerAnna Henningsen <anna@addaleax.net>2018-01-07 22:36:08 +0100
commit46f783d74fd3c9a011b30870e11f2194e6d08af4 (patch)
treeccead433438aceebd8b68c7ab0f9a85cab350144 /src/tls_wrap.h
parentd5fa4de00f8d9b95daa01b39a5307e9a9da44d35 (diff)
downloadandroid-node-v8-46f783d74fd3c9a011b30870e11f2194e6d08af4.tar.gz
android-node-v8-46f783d74fd3c9a011b30870e11f2194e6d08af4.tar.bz2
android-node-v8-46f783d74fd3c9a011b30870e11f2194e6d08af4.zip
tls: remove cleartext input data queue
The TLS implementation previously kept a separate buffer for incoming pieces of data, into which buffers were copied before they were up for writing. This removes this buffer, and replaces it with a simple list of `uv_buf_t`s: - The previous implementation copied all incoming data into that buffer, both allocating new storage and wasting time with copy operations. Node’s streams/net implementation already has to make sure that the allocated memory stays fresh until the write is finished, since that is what libuv streams rely on anyway. - The fact that a separate kind of buffer, `crypto::NodeBIO` was used, was confusing: These `BIO` instances are only used to communicate with openssl’s streams system otherwise, whereas this one was purely for internal memory management. - The name `clear_in_` was not very helpful. PR-URL: https://github.com/nodejs/node/pull/17883 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/tls_wrap.h')
-rw-r--r--src/tls_wrap.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tls_wrap.h b/src/tls_wrap.h
index ffa4fb5b4d..ae83c82c32 100644
--- a/src/tls_wrap.h
+++ b/src/tls_wrap.h
@@ -101,7 +101,6 @@ class TLSWrap : public AsyncWrap,
void EncOutAfterWrite(WriteWrap* req_wrap, int status);
bool ClearIn();
void ClearOut();
- void MakePending();
bool InvokeQueued(int status, const char* error_str = nullptr);
inline void Cycle() {
@@ -158,7 +157,7 @@ class TLSWrap : public AsyncWrap,
StreamBase* stream_;
BIO* enc_in_;
BIO* enc_out_;
- crypto::NodeBIO* clear_in_;
+ std::vector<uv_buf_t> pending_cleartext_input_;
size_t write_size_;
WriteWrap* current_write_ = nullptr;
bool write_callback_scheduled_ = false;