aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common/channel_filter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/common/channel_filter.cc')
-rw-r--r--src/cpp/common/channel_filter.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc
index c0dc9dd63e..9aeb942f59 100644
--- a/src/cpp/common/channel_filter.cc
+++ b/src/cpp/common/channel_filter.cc
@@ -36,6 +36,8 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/cpp/common/channel_filter.h"
+#include <grpc++/impl/codegen/slice.h>
+
namespace grpc {
// MetadataBatch
@@ -45,7 +47,8 @@ grpc_linked_mdelem *MetadataBatch::AddMetadata(grpc_exec_ctx *exec_ctx,
const string &value) {
grpc_linked_mdelem *storage = new grpc_linked_mdelem;
memset(storage, 0, sizeof(grpc_linked_mdelem));
- storage->md = grpc_mdelem_from_strings(exec_ctx, key.c_str(), value.c_str());
+ storage->md = grpc_mdelem_from_slices(exec_ctx, SliceFromCopiedString(key),
+ SliceFromCopiedString(value));
grpc_metadata_batch_link_head(batch_, storage);
return storage;
}