diff options
author | David Garcia Quintas <dgq@google.com> | 2015-06-01 21:08:59 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-06-01 21:20:47 -0700 |
commit | 30bd4eb5cc268c0faa7a7b89f7be0af61598785f (patch) | |
tree | 245115eb3876511220c4cb8ebdce465ea90a085e /src/node/ext | |
parent | 1b932e77f0b6f99556df03e5147f243d3bce0277 (diff) |
Removed grpc_byte_buffer_reader_{create,destroy}.
Introduced grpc_byte_buffer_init instead. It's now the user's responsibility to
manage memory.
Diffstat (limited to 'src/node/ext')
-rw-r--r-- | src/node/ext/byte_buffer.cc | 6 |
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); } |