diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2014-01-24 22:08:25 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-01-24 22:09:42 +0400 |
commit | 640912d18a63704fd493059a72b19e6367c2fc1c (patch) | |
tree | 2ad0e6e465dd981897f89d218d5a354f00fa9cf6 /src/tls_wrap.h | |
parent | d019eac5b5fe3522f527547046a9baef8ab9572c (diff) | |
download | node-new-640912d18a63704fd493059a72b19e6367c2fc1c.tar.gz |
tls_wrap: propagate errors to write callbacks
fix #6903
Diffstat (limited to 'src/tls_wrap.h')
-rw-r--r-- | src/tls_wrap.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/tls_wrap.h b/src/tls_wrap.h index c1febe0e70..db78009ede 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -50,6 +50,7 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, v8::Handle<v8::Value> unused, v8::Handle<v8::Context> context); + const char* Error(); int DoWrite(WriteWrap* w, uv_buf_t* bufs, size_t count, @@ -98,7 +99,8 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, static void EncOutCb(uv_write_t* req, int status); bool ClearIn(); void ClearOut(); - void InvokeQueued(int status); + void MakePending(); + bool InvokeQueued(int status); inline void Cycle() { ClearIn(); @@ -106,7 +108,10 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, EncOut(); } - v8::Local<v8::Value> GetSSLError(int status, int* err); + v8::Local<v8::Value> GetSSLError(int status, int* err, const char** msg); + const char* PrintErrors(); + + static int PrintErrorsCb(const char* str, size_t len, void* arg); static void OnClientHelloParseEnd(void* arg); static void Wrap(const v8::FunctionCallbackInfo<v8::Value>& args); @@ -133,10 +138,11 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, size_t write_size_; size_t write_queue_size_; QUEUE write_item_queue_; - WriteItem* pending_write_item_; + QUEUE pending_write_items_; bool started_; bool established_; bool shutdown_; + const char* error_; // If true - delivered EOF to the js-land, either after `close_notify`, or // after the `UV_EOF` on socket. @@ -145,6 +151,9 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>, #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB v8::Persistent<v8::Value> sni_context_; #endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB + + static size_t error_off_; + static char error_buf_[1024]; }; } // namespace node |