From bdfc7ad957e3856cf19274ee9e72a7e13ebd683a Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 19 Aug 2015 18:34:45 -0700 Subject: [PATCH] Fixed wrong creation of metadata in compression. --- include/grpc/compression.h | 4 +++- src/core/channel/compress_filter.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/grpc/compression.h b/include/grpc/compression.h index e35fb03eb2a..9924baeca1a 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -67,7 +67,9 @@ int grpc_compression_algorithm_parse(const char *name, size_t name_length, grpc_compression_algorithm *algorithm); /** Updates \a name with the encoding name corresponding to a valid \a - * algorithm. Returns 1 upon success, 0 otherwise. */ + * algorithm. Note that the string returned through \a name upon success is + * statically allocated and shouldn't be freed. Returns 1 upon success, 0 + * otherwise. */ int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, char **name); diff --git a/src/core/channel/compress_filter.c b/src/core/channel/compress_filter.c index 20d723bbc19..762a4edc73c 100644 --- a/src/core/channel/compress_filter.c +++ b/src/core/channel/compress_filter.c @@ -216,7 +216,7 @@ static void process_send_ops(grpc_call_element *elem, [calld->compression_algorithm])); /* convey supported compression algorithms */ - grpc_metadata_batch_add_head( + grpc_metadata_batch_add_tail( &(sop->data.metadata), &calld->accept_encoding_storage, GRPC_MDELEM_REF(channeld->mdelem_accept_encoding));