diff options
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r-- | src/objective-c/GRPCClient/private/NSData+GRPC.m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/NSData+GRPC.m b/src/objective-c/GRPCClient/private/NSData+GRPC.m index 99c882ee92..98337799e9 100644 --- a/src/objective-c/GRPCClient/private/NSData+GRPC.m +++ b/src/objective-c/GRPCClient/private/NSData+GRPC.m @@ -43,6 +43,10 @@ static void MallocAndCopyByteBufferToCharArray(grpc_byte_buffer *buffer, size_t *length, char **array) { grpc_byte_buffer_reader reader; if (!grpc_byte_buffer_reader_init(&reader, buffer)) { + // grpc_byte_buffer_reader_init can fail if the data sent by the server + // could not be decompressed for any reason. This is an issue with the data + // coming from the server and thus we want the RPC to fail with error code + // INTERNAL. *array = NULL; *length = 0; return; |