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/node_crypto.h | |
parent | a4436bab7b83e311f8a4207b9c6d97acde4735ff (diff) | |
download | android-node-v8-75ea11fc08019bb1ffac81583ed7d0da3241a5b5.tar.gz android-node-v8-75ea11fc08019bb1ffac81583ed7d0da3241a5b5.tar.bz2 android-node-v8-75ea11fc08019bb1ffac81583ed7d0da3241a5b5.zip |
tls: introduce asynchronous `newSession`
fix #7105
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r-- | src/node_crypto.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h index 889d270c5c..729d4fc7f4 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -137,7 +137,8 @@ class SSLWrap { : env_(env), kind_(kind), next_sess_(NULL), - session_callbacks_(false) { + session_callbacks_(false), + new_session_wait_(false) { ssl_ = SSL_new(sc->ctx_); assert(ssl_ != NULL); } @@ -162,6 +163,7 @@ class SSLWrap { inline void enable_session_callbacks() { session_callbacks_ = true; } inline bool is_server() const { return kind_ == kServer; } inline bool is_client() const { return kind_ == kClient; } + inline bool is_waiting_new_session() const { return new_session_wait_; } protected: static void InitNPN(SecureContext* sc, Base* base); @@ -188,6 +190,7 @@ class SSLWrap { static void Renegotiate(const v8::FunctionCallbackInfo<v8::Value>& args); static void Shutdown(const v8::FunctionCallbackInfo<v8::Value>& args); static void GetTLSTicket(const v8::FunctionCallbackInfo<v8::Value>& args); + static void NewSessionDone(const v8::FunctionCallbackInfo<v8::Value>& args); #ifdef SSL_set_max_send_fragment static void SetMaxSendFragment( @@ -219,6 +222,7 @@ class SSLWrap { SSL_SESSION* next_sess_; SSL* ssl_; bool session_callbacks_; + bool new_session_wait_; ClientHelloParser hello_parser_; #ifdef OPENSSL_NPN_NEGOTIATED @@ -291,6 +295,7 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap { void ClearError(); void SetShutdownFlags(); + void NewSessionDoneCb(); Connection(Environment* env, v8::Local<v8::Object> wrap, @@ -319,6 +324,7 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap { friend class ClientHelloParser; friend class SecureContext; + friend class SSLWrap<Connection>; }; class CipherBase : public BaseObject { |