Skip to content

Commit 8428b52

Browse files
trevnorrisbnoordhuis
authored andcommitted
req_wrap: only grab domain object if in use
1 parent deda899 commit 8428b52

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/req_wrap.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define REQ_WRAP_H_
2424

2525
#include "ngx-queue.h"
26+
#include "node_internals.h"
2627

2728
namespace node {
2829

@@ -38,15 +39,16 @@ class ReqWrap {
3839
v8::HandleScope scope(node_isolate);
3940
object_ = v8::Persistent<v8::Object>::New(node_isolate, v8::Object::New());
4041

41-
v8::Local<v8::Value> domain = v8::Context::GetCurrent()
42-
->Global()
43-
->Get(process_symbol)
44-
->ToObject()
45-
->Get(domain_symbol);
42+
if (using_domains) {
43+
v8::Local<v8::Value> domain = v8::Context::GetCurrent()
44+
->Global()
45+
->Get(process_symbol)
46+
->ToObject()
47+
->Get(domain_symbol);
4648

47-
if (!domain->IsUndefined()) {
48-
// fprintf(stderr, "setting domain on ReqWrap\n");
49-
object_->Set(domain_symbol, domain);
49+
if (!domain->IsUndefined()) {
50+
object_->Set(domain_symbol, domain);
51+
}
5052
}
5153

5254
ngx_queue_insert_tail(&req_wrap_queue, &req_wrap_queue_);

0 commit comments

Comments
 (0)