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));