mirror of https://github.com/nodejs/node.git
req_wrap: only grab domain object if in use
parent
deda899d77
commit
8428b52e25
|
@ -23,6 +23,7 @@
|
||||||
#define REQ_WRAP_H_
|
#define REQ_WRAP_H_
|
||||||
|
|
||||||
#include "ngx-queue.h"
|
#include "ngx-queue.h"
|
||||||
|
#include "node_internals.h"
|
||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
|
|
||||||
|
@ -38,6 +39,7 @@ class ReqWrap {
|
||||||
v8::HandleScope scope(node_isolate);
|
v8::HandleScope scope(node_isolate);
|
||||||
object_ = v8::Persistent<v8::Object>::New(node_isolate, v8::Object::New());
|
object_ = v8::Persistent<v8::Object>::New(node_isolate, v8::Object::New());
|
||||||
|
|
||||||
|
if (using_domains) {
|
||||||
v8::Local<v8::Value> domain = v8::Context::GetCurrent()
|
v8::Local<v8::Value> domain = v8::Context::GetCurrent()
|
||||||
->Global()
|
->Global()
|
||||||
->Get(process_symbol)
|
->Get(process_symbol)
|
||||||
|
@ -45,9 +47,9 @@ class ReqWrap {
|
||||||
->Get(domain_symbol);
|
->Get(domain_symbol);
|
||||||
|
|
||||||
if (!domain->IsUndefined()) {
|
if (!domain->IsUndefined()) {
|
||||||
// fprintf(stderr, "setting domain on ReqWrap\n");
|
|
||||||
object_->Set(domain_symbol, domain);
|
object_->Set(domain_symbol, domain);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngx_queue_insert_tail(&req_wrap_queue, &req_wrap_queue_);
|
ngx_queue_insert_tail(&req_wrap_queue, &req_wrap_queue_);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue