The Wayback Machine - https://web.archive.org/web/20220419133758/https://github.com/nodejs/node/commit/57921ebec5
Skip to content
Permalink
Browse files
src: remove unnecessary HandleScopes
API function callbacks run inside an implicit HandleScope.  We don't
need to explicitly create one and in fact introduce some unnecessary
overhead when we do.

PR-URL: #7711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Oct 26, 2016
1 parent 6838ad5 commit 57921ebec54b5e73bb85426fa51d5638c5f51fc4
Showing with 0 additions and 5 deletions.
  1. +0 −5 src/node_crypto.cc
@@ -1776,8 +1776,6 @@ template <class Base>
void SSLWrap<Base>::SetOCSPResponse(
const v8::FunctionCallbackInfo<v8::Value>& args) {
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
HandleScope scope(args.GetIsolate());

Base* w = Unwrap<Base>(args.Holder());
if (args.Length() < 1 || !Buffer::HasInstance(args[0]))
return w->env()->ThrowTypeError("Must give a Buffer as first argument");
@@ -1791,8 +1789,6 @@ template <class Base>
void SSLWrap<Base>::RequestOCSP(
const v8::FunctionCallbackInfo<v8::Value>& args) {
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
HandleScope scope(args.GetIsolate());

Base* w = Unwrap<Base>(args.Holder());

SSL_set_tlsext_status_type(w->ssl_, TLSEXT_STATUSTYPE_ocsp);
@@ -1804,7 +1800,6 @@ void SSLWrap<Base>::RequestOCSP(
template <class Base>
void SSLWrap<Base>::SetMaxSendFragment(
const v8::FunctionCallbackInfo<v8::Value>& args) {
HandleScope scope(args.GetIsolate());
CHECK(args.Length() >= 1 && args[0]->IsNumber());

Base* w = Unwrap<Base>(args.Holder());

0 comments on commit 57921eb

Please sign in to comment.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.