aboutsummaryrefslogtreecommitdiff
path: root/src/tls_wrap.cc
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2015-03-05 18:26:01 -0500
committerFedor Indutny <fedor@indutny.com>2015-03-06 11:01:32 -0500
commit583a868bcdd9254d597fc459df9fa43c1f313f74 (patch)
tree4241fc845a2335d31b19b4e975c9ca0459c19c3c /src/tls_wrap.cc
parentb27931b0fedc5fad638d637525aba84b2754ed5f (diff)
downloadandroid-node-v8-583a868bcdd9254d597fc459df9fa43c1f313f74.tar.gz
android-node-v8-583a868bcdd9254d597fc459df9fa43c1f313f74.tar.bz2
android-node-v8-583a868bcdd9254d597fc459df9fa43c1f313f74.zip
stream_wrap: add HandleScope's in uv callbacks
Ensure that no handles will leak into global HandleScope by adding HandleScope's in all JS-calling libuv callbacks in `stream_wrap.cc`. Fix: https://github.com/iojs/io.js/issues/1075 PR-URL: https://github.com/iojs/io.js/pull/1078 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r--src/tls_wrap.cc14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 1647ab669b..b05b8891d0 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -26,7 +26,6 @@ using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::Handle;
-using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Null;
@@ -251,8 +250,6 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) {
SSL* ssl = const_cast<SSL*>(ssl_);
TLSWrap* c = static_cast<TLSWrap*>(SSL_get_app_data(ssl));
Environment* env = c->env();
- HandleScope handle_scope(env->isolate());
- Context::Scope context_scope(env->context());
Local<Object> object = c->object();
if (where & SSL_CB_HANDSHAKE_START) {
@@ -395,9 +392,6 @@ void TLSWrap::ClearOut() {
if (eof_)
return;
- HandleScope handle_scope(env()->isolate());
- Context::Scope context_scope(env()->context());
-
CHECK_NE(ssl_, nullptr);
char out[kClearOutChunkSize];
@@ -470,9 +464,6 @@ bool TLSWrap::ClearIn() {
return true;
}
- HandleScope handle_scope(env()->isolate());
- Context::Scope context_scope(env()->context());
-
// Error or partial write
int err;
Local<Value> arg = GetSSLError(written, &err, &error_);
@@ -588,8 +579,6 @@ int TLSWrap::DoWrite(WriteWrap* w,
if (i != count) {
int err;
- HandleScope handle_scope(env()->isolate());
- Context::Scope context_scope(env()->context());
Local<Value> arg = GetSSLError(written, &err, &error_);
if (!arg.IsEmpty())
return UV_EPROTO;
@@ -662,8 +651,6 @@ void TLSWrap::DoRead(ssize_t nread,
eof_ = true;
}
- HandleScope handle_scope(env()->isolate());
- Context::Scope context_scope(env()->context());
OnRead(nread, nullptr);
return;
}
@@ -796,7 +783,6 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) {
if (servername == nullptr)
return SSL_TLSEXT_ERR_OK;
- HandleScope scope(env->isolate());
// Call the SNI callback and use its return value as context
Local<Object> object = p->object();
Local<Value> ctx = object->Get(env->sni_context_string());