req_wrap: only grab domain object if in use

pull/5010/head
Trevor Norris 2013-04-09 15:31:22 -07:00 committed by Ben Noordhuis
parent deda899d77
commit 8428b52e25
1 changed files with 10 additions and 8 deletions

View File

@ -23,6 +23,7 @@
#define REQ_WRAP_H_
#include "ngx-queue.h"
#include "node_internals.h"
namespace node {
@ -38,6 +39,7 @@ class ReqWrap {
v8::HandleScope scope(node_isolate);
object_ = v8::Persistent<v8::Object>::New(node_isolate, v8::Object::New());
if (using_domains) {
v8::Local<v8::Value> domain = v8::Context::GetCurrent()
->Global()
->Get(process_symbol)
@ -45,9 +47,9 @@ class ReqWrap {
->Get(domain_symbol);
if (!domain->IsUndefined()) {
// fprintf(stderr, "setting domain on ReqWrap\n");
object_->Set(domain_symbol, domain);
}
}
ngx_queue_insert_tail(&req_wrap_queue, &req_wrap_queue_);
}