Merged from release_0.11

pull/3365/head
murgatroid99 9 years ago
commit 62420a29b7
  1. 2
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  2. 5
      src/node/ext/call.cc
  3. 2
      src/node/ext/call.h
  4. 6
      src/node/src/server.js

@ -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)

@ -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 {

@ -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);

@ -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;
}
});

Loading…
Cancel
Save