aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-09-17 14:00:05 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-09-17 14:00:05 -0700
commit62420a29b7e78539b2e33f1c22996f9527fb08f3 (patch)
tree581855bc3f5b5f5ec152a6e6b78351607988e41b
parent2b09783f8ad3aff8af6b1e5a9e3d799c4df1d4f1 (diff)
parent1965810ede1dae0aaf72d55e1359e640d08720f8 (diff)
Merged from release_0.11
-rw-r--r--src/csharp/Grpc.IntegrationTesting/InteropClient.cs2
-rw-r--r--src/node/ext/call.cc5
-rw-r--r--src/node/ext/call.h2
-rw-r--r--src/node/src/server.js6
4 files changed, 10 insertions, 5 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
index 0884c6ea60..616093d4ae 100644
--- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
@@ -131,7 +131,7 @@ namespace Grpc.IntegrationTesting
var channel = new Channel(options.ServerHost, options.ServerPort, credentials, channelOptions);
TestService.TestServiceClient client = new TestService.TestServiceClient(channel);
await RunTestCaseAsync(client, options);
- channel.ShutdownAsync().Wait();
+ await channel.ShutdownAsync();
}
private async Task RunTestCaseAsync(TestService.TestServiceClient client, ClientOptions options)
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
index 7e79a612ee..b08a9f96d8 100644
--- a/src/node/ext/call.cc
+++ b/src/node/ext/call.cc
@@ -184,6 +184,9 @@ Local<Value> Op::GetOpType() const {
return scope.Escape(Nan::New(GetTypeString()).ToLocalChecked());
}
+Op::~Op() {
+}
+
class SendMetadataOp : public Op {
public:
Local<Value> GetNodeValue() const {
@@ -359,7 +362,7 @@ class ReadMessageOp : public Op {
}
~ReadMessageOp() {
if (recv_message != NULL) {
- gpr_free(recv_message);
+ grpc_byte_buffer_destroy(recv_message);
}
}
Local<Value> GetNodeValue() const {
diff --git a/src/node/ext/call.h b/src/node/ext/call.h
index 1f387edc64..2f8e1f17aa 100644
--- a/src/node/ext/call.h
+++ b/src/node/ext/call.h
@@ -78,6 +78,7 @@ class Op {
virtual v8::Local<v8::Value> GetNodeValue() const = 0;
virtual bool ParseOp(v8::Local<v8::Value> value, grpc_op *out,
shared_ptr<Resources> resources) = 0;
+ virtual ~Op();
v8::Local<v8::Value> GetOpType() const;
protected:
@@ -85,7 +86,6 @@ class Op {
};
typedef std::vector<unique_ptr<Op>> OpVec;
-
struct tag {
tag(Nan::Callback *callback, OpVec *ops,
shared_ptr<Resources> resources);
diff --git a/src/node/src/server.js b/src/node/src/server.js
index b6f162adf8..70b4a9d80e 100644
--- a/src/node/src/server.js
+++ b/src/node/src/server.js
@@ -276,6 +276,7 @@ function ServerWritableStream(call, serialize) {
function _write(chunk, encoding, callback) {
/* jshint validthis: true */
var batch = {};
+ var self = this;
if (!this.call.metadataSent) {
batch[grpc.opType.SEND_INITIAL_METADATA] =
(new Metadata())._getCoreRepresentation();
@@ -290,7 +291,7 @@ function _write(chunk, encoding, callback) {
batch[grpc.opType.SEND_MESSAGE] = message;
this.call.startBatch(batch, function(err, value) {
if (err) {
- this.emit('error', err);
+ self.emit('error', err);
return;
}
callback();
@@ -305,6 +306,7 @@ ServerWritableStream.prototype._write = _write;
*/
function sendMetadata(responseMetadata) {
/* jshint validthis: true */
+ var self = this;
if (!this.call.metadataSent) {
this.call.metadataSent = true;
var batch = [];
@@ -312,7 +314,7 @@ function sendMetadata(responseMetadata) {
responseMetadata._getCoreRepresentation();
this.call.startBatch(batch, function(err) {
if (err) {
- this.emit('error', err);
+ self.emit('error', err);
return;
}
});