diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2014-02-14 17:01:34 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-02-18 01:07:09 +0400 |
commit | 75ea11fc08019bb1ffac81583ed7d0da3241a5b5 (patch) | |
tree | a93575a064c35f8ced63c1dcb34f0e6af8ff6d77 /src/tls_wrap.h | |
parent | a4436bab7b83e311f8a4207b9c6d97acde4735ff (diff) | |
download | node-new-75ea11fc08019bb1ffac81583ed7d0da3241a5b5.tar.gz |
tls: introduce asynchronous `newSession`
fix #7105
Diffstat (limited to 'src/tls_wrap.h')
-rw-r--r-- | src/tls_wrap.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 946cc1c64d..646e70108f 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -102,11 +102,18 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, void ClearOut(); void MakePending(); bool InvokeQueued(int status); + void NewSessionDoneCb(); inline void Cycle() { - ClearIn(); - ClearOut(); - EncOut(); + // Prevent recursion + if (++cycle_depth_ > 1) + return; + + for (; cycle_depth_ > 0; cycle_depth_--) { + ClearIn(); + ClearOut(); + EncOut(); + } } v8::Local<v8::Value> GetSSLError(int status, int* err, const char** msg); @@ -144,6 +151,7 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, bool established_; bool shutdown_; const char* error_; + int cycle_depth_; // If true - delivered EOF to the js-land, either after `close_notify`, or // after the `UV_EOF` on socket. @@ -155,6 +163,8 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, static size_t error_off_; static char error_buf_[1024]; + + friend class SSLWrap<TLSCallbacks>; }; } // namespace node |