Fixed missing increment

pull/1363/head
murgatroid99 10 years ago
parent def47aa9f3
commit a571cebe01
  1. 4
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m
  2. 2
      src/objective-c/GRPCClient/private/NSDictionary+GRPC.h
  3. 2
      src/objective-c/GRPCClient/private/NSDictionary+GRPC.m

@ -53,7 +53,7 @@
- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)(void))handler { - (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)(void))handler {
if (self = [super init]) { if (self = [super init]) {
_send_metadata = [metadata grpc_getMetadataArray]; _send_metadata = [metadata grpc_metadataArray];
_count = metadata.count; _count = metadata.count;
_handler = handler; _handler = handler;
} }
@ -292,7 +292,7 @@
grpc_op *ops_array = gpr_malloc(nops * sizeof(grpc_op)); grpc_op *ops_array = gpr_malloc(nops * sizeof(grpc_op));
size_t i = 0; size_t i = 0;
for (id op in operations) { for (id op in operations) {
[op getOp:&ops_array[i]]; [op getOp:&ops_array[i++]];
[opProcessors addObject:[op opProcessor]]; [opProcessors addObject:[op opProcessor]];
} }
grpc_call_error error = grpc_call_start_batch(_call, ops_array, nops, grpc_call_error error = grpc_call_start_batch(_call, ops_array, nops,

@ -36,5 +36,5 @@
@interface NSDictionary (GRPC) @interface NSDictionary (GRPC)
+ (instancetype)grpc_dictionaryFromMetadata:(struct grpc_metadata *)entries count:(size_t)count; + (instancetype)grpc_dictionaryFromMetadata:(struct grpc_metadata *)entries count:(size_t)count;
- (grpc_metadata *)grpc_getMetadataArray; - (grpc_metadata *)grpc_metadataArray;
@end @end

@ -54,7 +54,7 @@
return metadata; return metadata;
} }
- (grpc_metadata *)grpc_getMetadataArray { - (grpc_metadata *)grpc_metadataArray {
grpc_metadata *metadata = gpr_malloc([self count] * sizeof(grpc_metadata)); grpc_metadata *metadata = gpr_malloc([self count] * sizeof(grpc_metadata));
int i = 0; int i = 0;
for (id key in self) { for (id key in self) {

Loading…
Cancel
Save