From 606e35a4fb2a6e7dd711e7a2eec6c59bf6f2258b Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Jun 2016 12:26:36 -0700 Subject: [PATCH] add C# constant for GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY --- src/csharp/Grpc.Core.Tests/CompressionTest.cs | 2 +- src/csharp/Grpc.Core/Metadata.cs | 7 +++++++ src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/CompressionTest.cs b/src/csharp/Grpc.Core.Tests/CompressionTest.cs index f2f2931e480..16be210508a 100644 --- a/src/csharp/Grpc.Core.Tests/CompressionTest.cs +++ b/src/csharp/Grpc.Core.Tests/CompressionTest.cs @@ -125,7 +125,7 @@ namespace Grpc.Core.Tests { var compressionMetadata = new Metadata { - { new Metadata.Entry("grpc-internal-encoding-request", "gzip") } + { new Metadata.Entry(Metadata.CompressionRequestAlgorithmMetadataKey, "gzip") } }; helper.UnaryHandler = new UnaryServerMethod(async (req, context) => diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index f73f720094a..915bec146c9 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -63,6 +63,13 @@ namespace Grpc.Core /// public static readonly Metadata Empty = new Metadata().Freeze(); + /// + /// To be used in initial metadata to request specific compression algorithm + /// for given call. Direct selection of compression algorithms is an internal + /// feature and is not part of public API. + /// + internal const string CompressionRequestAlgorithmMetadataKey = "grpc-internal-encoding-request"; + readonly List entries; bool readOnly; diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 17ef587d168..e27fe5b3d80 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -724,7 +724,7 @@ namespace Grpc.IntegrationTesting var algorithmName = compressed ? "gzip" : "identity"; return new Metadata { - { new Metadata.Entry("grpc-internal-encoding-request", algorithmName) } + { new Metadata.Entry(Metadata.CompressionRequestAlgorithmMetadataKey, algorithmName) } }; }