aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/ext
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-04 08:43:47 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-04 08:43:47 -0700
commit7b6e979f46174ffe1893bea868b3cd9f18c25639 (patch)
tree5bb1f5609186f406a1c36dec77815fe31ef3b9a7 /src/node/ext
parenta4b89fed1c801cdb31a154c7e1c09e5650898e8a (diff)
parentbed8a0699e7440ab13cddda03a398bad26117f5b (diff)
Merge github.com:grpc/grpc into you-complete-me
Diffstat (limited to 'src/node/ext')
-rw-r--r--src/node/ext/byte_buffer.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index 01bd92ea52..2c84099069 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -36,6 +36,7 @@
#include <node.h>
#include <nan.h>
#include "grpc/grpc.h"
+#include "grpc/byte_buffer_reader.h"
#include "grpc/support/slice.h"
#include "byte_buffer.h"
@@ -69,9 +70,10 @@ Handle<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
size_t length = grpc_byte_buffer_length(buffer);
char *result = reinterpret_cast<char *>(calloc(length, sizeof(char)));
size_t offset = 0;
- grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader, buffer);
gpr_slice next;
- while (grpc_byte_buffer_reader_next(reader, &next) != 0) {
+ while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
memcpy(result + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
}