diff options
author | Craig Tiller <ctiller@google.com> | 2017-01-20 15:42:47 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-01-20 15:42:47 -0800 |
commit | da9de8988b343a6c87a9c3ba6b4594020943b0a7 (patch) | |
tree | eee5260113f8aef5919422558900f582753a464d /src/node/ext/server.cc | |
parent | 1d77059e4b1ec17c704acfc876e321cc33bff99d (diff) | |
parent | 4a4a3a446871da594ef4662751e707789f2829c2 (diff) |
Merge github.com:grpc/grpc into maxmsgsz
Diffstat (limited to 'src/node/ext/server.cc')
-rw-r--r-- | src/node/ext/server.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/node/ext/server.cc b/src/node/ext/server.cc index 70d5b96f39..4761b2867d 100644 --- a/src/node/ext/server.cc +++ b/src/node/ext/server.cc @@ -46,6 +46,7 @@ #include "grpc/grpc_security.h" #include "grpc/support/log.h" #include "server_credentials.h" +#include "slice.h" #include "timeval.h" namespace grpc { @@ -99,10 +100,11 @@ class NewCallOp : public Op { } Local<Object> obj = Nan::New<Object>(); Nan::Set(obj, Nan::New("call").ToLocalChecked(), Call::WrapStruct(call)); + // TODO(murgatroid99): Use zero-copy string construction instead Nan::Set(obj, Nan::New("method").ToLocalChecked(), - Nan::New(details.method).ToLocalChecked()); + CopyStringFromSlice(details.method)); Nan::Set(obj, Nan::New("host").ToLocalChecked(), - Nan::New(details.host).ToLocalChecked()); + CopyStringFromSlice(details.host)); Nan::Set(obj, Nan::New("deadline").ToLocalChecked(), Nan::New<Date>(TimespecToMilliseconds(details.deadline)) .ToLocalChecked()); @@ -111,8 +113,7 @@ class NewCallOp : public Op { return scope.Escape(obj); } - bool ParseOp(Local<Value> value, grpc_op *out, - shared_ptr<Resources> resources) { + bool ParseOp(Local<Value> value, grpc_op *out) { return true; } bool IsFinalOp() { @@ -139,8 +140,7 @@ class ServerShutdownOp : public Op { return Nan::New<External>(reinterpret_cast<void *>(server)); } - bool ParseOp(Local<Value> value, grpc_op *out, - shared_ptr<Resources> resources) { + bool ParseOp(Local<Value> value, grpc_op *out) { return true; } bool IsFinalOp() { @@ -207,8 +207,7 @@ void Server::ShutdownServer() { grpc_server_shutdown_and_notify( this->wrapped_server, GetCompletionQueue(), - new struct tag(new Callback(**shutdown_callback), ops.release(), - shared_ptr<Resources>(nullptr), NULL)); + new struct tag(new Callback(**shutdown_callback), ops.release(), NULL)); grpc_server_cancel_all_calls(this->wrapped_server); CompletionQueueNext(); this->wrapped_server = NULL; @@ -261,7 +260,7 @@ NAN_METHOD(Server::RequestCall) { GetCompletionQueue(), GetCompletionQueue(), new struct tag(new Callback(info[0].As<Function>()), ops.release(), - shared_ptr<Resources>(nullptr), NULL)); + NULL)); if (error != GRPC_CALL_OK) { return Nan::ThrowError(nanErrorWithCode("requestCall failed", error)); } @@ -314,7 +313,7 @@ NAN_METHOD(Server::TryShutdown) { grpc_server_shutdown_and_notify( server->wrapped_server, GetCompletionQueue(), new struct tag(new Nan::Callback(info[0].As<Function>()), ops.release(), - shared_ptr<Resources>(nullptr), NULL)); + NULL)); CompletionQueueNext(); } |