diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2015-07-21 18:28:16 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2015-07-21 18:28:16 -0700 |
commit | 7717202c2b2f451bfc92cd475b85b106cc07374a (patch) | |
tree | be04d88b04acb0e708d3a1ceb99e3dc469966b96 /src/csharp/ext | |
parent | e7e1c82d5e5f9bcad91390bd9b7c73c51c45f8cb (diff) |
fix crash caused by wrong size of MetadataEntryStruct
Diffstat (limited to 'src/csharp/ext')
-rw-r--r-- | src/csharp/ext/grpc_csharp_ext.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index bd0a259593..682521446f 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -172,10 +172,22 @@ grpcsharp_metadata_array_count(grpc_metadata_array *array) { return (gpr_intptr) array->count; } -GPR_EXPORT grpc_metadata GPR_CALLTYPE -grpcsharp_metadata_array_get(grpc_metadata_array *array, size_t index) { +GPR_EXPORT const char *GPR_CALLTYPE +grpcsharp_metadata_array_get_key(grpc_metadata_array *array, size_t index) { + GPR_ASSERT(index < array->count); + return array->metadata[index].key; +} + +GPR_EXPORT const char *GPR_CALLTYPE +grpcsharp_metadata_array_get_value(grpc_metadata_array *array, size_t index) { + GPR_ASSERT(index < array->count); + return array->metadata[index].value; +} + +GPR_EXPORT gpr_intptr GPR_CALLTYPE +grpcsharp_metadata_array_get_value_length(grpc_metadata_array *array, size_t index) { GPR_ASSERT(index < array->count); - return array->metadata[index]; + return (gpr_intptr) array->metadata[index].value_length; } /* Move contents of metadata array */ |